Willow Posted October 14, 2010 Share Posted October 14, 2010 I need to update several internal computers on the network from one central pc. The basic concept is the user is prompted for an IP address then the program is run remotely with psexec.exe. I am having trouble getting the IP address variable passed to psexec.exe so that it will run on the remote pc. Any help is much appreciated. FileInstall("C:\autoitcode\updates.exe", "c:\data\updates.exe") FileInstall("C:\autoitcode\psexec.exe", "c:\data\psexec.exe") $a = InputBox("Get IP", "Enter IP Address.") RunWait("c:\data\psexec -c -f -d \\"&$a, "updates.exe /S") Link to comment Share on other sites More sharing options...
Developers Jos Posted October 14, 2010 Developers Share Posted October 14, 2010 (edited) I do not understand what you want to do here. PSEXEC is normally used on a IT Tech's PC to run a program on a Remote User PC. so why is the script ran on the Users PC and prompting for what IP address? jos Edited October 14, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Willow Posted October 14, 2010 Author Share Posted October 14, 2010 I do not understand what you want to do here. PSEXEC is normally used on a IT Tech's PC to run a program on a Remote User PC.so why is the script ran on the Users PC and prompting for what IP address?josTo clarify, the autoit script is designed to run on the IT tech's pc, however he/she will need to input the IP of the remote pc. Link to comment Share on other sites More sharing options...
Developers Jos Posted October 14, 2010 Developers Share Posted October 14, 2010 To clarify, the autoit script is designed to run on the IT tech's pc, however he/she will need to input the IP of the remote pc. ok, so what should the commandline look like when you type it manually on the command prompt, because your Run() statement looks wrong as it contains a comma after a$. Maybe: RunWait("c:\data\psexec -c -f -d \\" & $a & " updates.exe /S") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
enaiman Posted October 14, 2010 Share Posted October 14, 2010 I think you are making a mistake somewhere - "updates.exe" is supposed to be on the remote machine not on your machine. The purpose of psexec is to execute apps on remote machine. For the correct command line syntax, see the documentation for psexec ... it might be tricky sometimes. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
Willow Posted October 14, 2010 Author Share Posted October 14, 2010 ok, so what should the commandline look like when you type it manually on the command prompt, because your Run() statement looks wrong as it contains a comma after a$. Maybe: RunWait("c:\data\psexec -c -f -d \\" & $a & " updates.exe /S") Thanks, that worked! Link to comment Share on other sites More sharing options...
Willow Posted October 14, 2010 Author Share Posted October 14, 2010 (edited) I think you are making a mistake somewhere - "updates.exe" is supposed to be on the remote machine not on your machine.The purpose of psexec is to execute apps on remote machine.For the correct command line syntax, see the documentation for psexec ... it might be tricky sometimes.The -c option for psexec will copy the file ("updates.exe") to the remote pc. The -f option works in tandem with -c and will overwrite any older copies of files on the remote pc, which in this case is "updates.exe. Edited October 14, 2010 by Willow Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now