Jump to content

Run AutoIt script remotely using psexec


Recommended Posts

I am trying to run an AutoIt script on a remote machine.

psexec.exe -accepteula \\remotemachine -u admin -p password "C:\Program Files\AutoIt3\AutoIt3.exe" "C:\Users\admin\runNotepad.au3"

I am trying to open a Notepad from the script and write something in it. I am also writing some logs from the script. Although I can see the logs, but I am not able to see anything happening on the screen.

I tried with argument -i 0 which opens an interactive screen which is not same as running the script on a local machine. e.g. I will have to accept the interactive session and sometimes it does not show up. Sometimes then windows explorer does not open if I say 

Run("explorer.exe")

 from the script Is there any other way to do it? I tried creating an exe but it still goes into the interactive session window which I cannot handle remotely. I tried running it through a batch file but it does not work either.

Edited by dilipped
Link to comment
Share on other sites

Most of the time you have to use the same user logged on the remote pc, what has work for me sometimes, is run a batch file in the remote pc that runs the script file, instead runing the script.

And use also -s

psexec -i -s

Link to comment
Share on other sites

  • 1 year later...

For the record,

the following single line local script ran existing remote script  "C:\WIP-GUI.au3" fine:

Run('psexec \\remotemachine -u admin -p password -i -d "C:\Program Files\Autoit3\AutoIt3.exe" C:\WIP-GUI.au3', '', @SW_HIDE)

Local was Win7 Professional 64bit

Remote was WinXP Professional 32bit on which I first had to Access hidden share:

Start > Run > secpol.msc > Local Policies > Security Options > 
Network Access: Sharing and security model for local accounts > Classic – local users authenticate as themselves

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...