Jump to content
Sign in to follow this  
jcavazos

Help with remotely running Program

Recommended Posts

jcavazos

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 :lmao:

Thanks

Share this post


Link to post
Share on other sites
herewasplato

...

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.aspx

Sorry 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 by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
Manjish

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 by Manjish

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites
azure

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)

Share this post


Link to post
Share on other sites
jcavazos

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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.