This question is an exact duplicate of:
- Script doesnt run from another script 1 answer
I am using autoit scripting language for automation. I have created an executable of autoit script so that I can run it anywhere. I have uploaded the executable to a different server. I then wrote a windows powershell script which downloads the autoit exe from that server and runs it on windows server 2012. When I run the powershell script manually on windows server 2012, it runs without issues and completes the autoit script. But when I put a powershell script in an application which automatically executes that, the autoit exe gets downloaded successfully but it does not run completely. It gets stuck at the last 2 windows of that third party application. Following is the sample of a script that I have used for automation on each window:
_FileWriteLog($hFile, "Reboot Window")
$hWnd = WinWait("Install","This system must be ")
_FileWriteLog($hFile, $hWnd)
ControlClick($hWnd, "", "[CLASS:Button; INSTANCE:3]")
Any help would be appreciated .. !! Thanks..