jcavazos Posted January 30, 2009 Posted January 30, 2009 Hi, I am fairly new with AutoIt... But I am learning and I am enjoying it a lot. I am in need of some help I have a script I have made the copies some files to a remote computer but I am having problems running the executable. How can I with Autoit execute the per say (abc.exe) file on the remote computer. I have tried the follow with psexec: RunWait(@ComSpec & " /C" & 'psexec.exe \\remote_pc c:\TEMP\abc.exe', @TempDir, @SW_HIDE) If I execute the file manually the file starts and runs as a process like it needs to. Any help is appreciated Thanks
herewasplato Posted January 30, 2009 Posted January 30, 2009 (edited) ...RunWait(@ComSpec & " /C" & 'psexec.exe \\remote_pc c:\TEMP\abc.exe', @TempDir, @SW_HIDE)...Welcome to the forum.It depends on what abc.exe does as to how you need to setup psexec.The "-i" option/switch does this:Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.It depends on where abc.exe is located...The "-c" option/switch does this:Copy the specified program to the remote system for execution. If you omit this option then the application must be in the system's path on the remote system.http://technet.microsoft.com/en-us/sysinte...s/bb897553.aspxSorry if you already knew that and don't need either switch. I just could not tell without knowing more about abc.exe....and then there are the user and password switches :-) Edit: cleaned up copy/paste/post formatting mess Edited January 30, 2009 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
Manjish Posted January 30, 2009 Posted January 30, 2009 (edited) Hey, I think i know ur problem, since I have worked a lot with psexec. U have to specify the username and password of remote m/c.. Like this: RunWait(@ComSpec & " /C" & 'psexec \\remote_pc -u <username> -p <password> c:\TEMP\abc.exe', @TempDir, @SW_HIDE) Edited January 30, 2009 by Manjish [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
azure Posted January 30, 2009 Posted January 30, 2009 Hey, I think i know ur problem, since I have worked a lot with psexec. U have to specify the username and password of remote m/c.. Like this: RunWait(@ComSpec & " /C" & 'psexec \\remote_pc -u <username> -p <password> c:\TEMP\abc.exe', @TempDir, @SW_HIDE) You may also want to try using comspec again within your psexec statement RunWait(@COMSPEC & " /C psexec \\remote_pc -u <username> -p <password> " & @COMSPEC & " /c C:\temp\abc.exe", @TEMPDIR, @SW_HIDE)
jcavazos Posted February 4, 2009 Author Posted February 4, 2009 Thanks you all Got it working with RunWait(@COMSPEC & " /C psexec \\remote_pc -u <username> -p <password> " & @COMSPEC & " /c C:\temp\abc.exe", @TEMPDIR, @SW_HIDE)
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