#!Perl use 5.010; # Defines variables $ipInput = 0; $userName = 0; $passWord = 0; $ip = 0; # Defines the IP array @ip = (); # User input say "Please enter the username:"; $userName = ; say ""; say "Please enter the password:"; $passWord = ; say ""; say "Please enter the ip addresses of the machines you would like to install VNC on"; say ""; say "Ex: xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx etc..."; $ipInput = ; # Sets delimeter for array input @ip = split(',',$ipInput); # A loop that will perform the operation on each machine, from wich an ip was given foreach $ip(@ip) { # Initiate the connection 'net use \\\\$ip\\IPC$ /user:$userName $passWord'; # Copies the program files 'xcopy "C:\\Program Files\\UltraVNC\\*.*" "\\\\$ip\\C$\\Program Files\\UltraVNC\\*.*" /r/i/c/h/k/e/Y'; # Dumps the registry 'regedit /e "\\\\$ip\\C$\\vncdmp.txt" "HKEY_LOCAL_MACHINE\\Software\\ORL"'; # Puts registry entries on remote machine 'psexec \\\\$ip -s -i -d %windir%\\regedit /s C:\\vncdmp.txt'; # Installs the program as a service 'psexec \\\\$ip -s -i -d "C:\\Program Files\\UltraVNC\\winvnc.exe" -install'; # Starts the VNC server 'psexec \\\\$ip -s -i -d net start "VNC Server"'; }