Lobus has asked for the wisdom of the Perl Monks concerning the following question:
Additionally, I do not know if it matters but I am using Active Perl.#!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 = <STDIN>; say ""; say "Please enter the password:"; $passWord = <STDIN>; say ""; say "Please enter the ip addresses of the machines you would like to i +nstall VNC on"; say ""; say "Ex: xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx etc..."; $ipInput = <STDIN>; # 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\\O +RL"'; # 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" -in +stall'; # Starts the VNC server 'psexec \\\\$ip -s -i -d net start "VNC Server"'; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trouble with net use
by holli (Abbot) on Jan 30, 2009 at 17:44 UTC | |
|
Re: Trouble with net use
by kennethk (Abbot) on Jan 30, 2009 at 17:47 UTC | |
|
Re: Trouble with net use
by codeacrobat (Chaplain) on Jan 30, 2009 at 18:06 UTC | |
by Lobus (Initiate) on Feb 02, 2009 at 17:38 UTC |