Sign in to follow this  
Followers 0
EndFunc

Run AutoIt Remotely - Nothing seems to work

7 posts in this topic

I've been trying to execute an AutoIT script on a remote server and not having any luck. I don't want to do the old create a sched task to have it run. 

I've tried calling it from powershell (Invoke-Command), WinRS and PSexec. They run but the script never starts. No error messages. 

PSexec gives this result within a few seconds. Which means it ran. 

d:myautoit.exe exited on servername with error code 0

I'm not sure why it won't run. I even added RequireAdmin to the code to see if thats the issue. Ran PSexec with the -i and -s options and even passed my creds with no luck.

Why won't this script run? Works fine if I double click it. The autoit exe does a package install by calling an msi and does some configurations after awhile so it's not something that is done fast. I should see it in the task manager for a while just like when I run it manually. I'm hoping someone has some suggestions. 


EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites



What is the OS of the remote pc? Can you get other exe's to run?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

What is the OS of the remote pc? Can you get other exe's to run?

Win2012. Hmm, It appears to be running when using system account, I have been wachting task manager closer, but it starts and goes away, so something is erroring out. Event logs don't show anything useful that I can see. 


EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Can you setup a openssh tunnel and run it from the command and see what that does? Not sure why it will run as system but not admin.

Edit - Can you watch the gui from teamviewer or something when you run the script to see what it is doing visually? Add some debug code to slow it down ie msgbox's with error messages.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

Can you setup a openssh tunnel and run it from the command and see what that does? Not sure why it will run as system but not admin.

Edit - Can you watch the gui from teamviewer or something when you run the script to see what it is doing visually? Add some debug code to slow it down ie msgbox's with error messages.

Yeah I'll see what I can do. I can't use openssh with this server but I'll keep testing and put some debug code in. I don't get it either. I'll also test with my account again after putting some debug code in. 


EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites

I was able to get farther now and I had to change RunWait to ShellExecuteWait to get part of the script working. But the problem it seems to having now is spaces in the UNC path. 

Local $hSearch = FileFindFirstFile("\\srv01\software\Server Software\scripts\latest_tsm\*.exe")

 

It fails on this when compiled and called remotely. It works when not compiled and ran from the server.


EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

$Varaible1 = "srv01softwareServer Softwarescriptslatest_tsm*.exe"

Local $hSearch = FileFindFirstFile($Variable1)

Just a guess

Your problem might be the *

$Varaible1 = "srv01softwareServer Softwarescriptslatest_tsm{*}.exe"

Local $hSearch = FileFindFirstFile($Variable1)

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

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  
Followers 0