I'm using AutoIt thru COM/ActiveX w/ VBScript but I'm sure the issue is the same with the native AutoIt script.
I've noticed that running AutoIt GUI automation (that usually requires an interactive session/logon, I think) has some issues if the following are involved: computer is locked, automation was run within a remote desktop session, or remote desktop was used to access the console session of computer and later disconnected, where console session was running the automation.
It seems that when computer is locked (purposely or due to remote desktop locking the console session (Windows XP and 2003), the automation does not run.
The following 2 cases occur:
- if automation was running, it will pause execution until computer is unlocked
- if automation is called remotely, via psexec, etc., after computer is locked, automation will fail. I have some scripts that return the GUI window detection function's return code. In this case, the return code indicates failure. Unlocking the computer fixes the problem.
This kind of sucks when you don't have enough hardware or workspace to have a physical KVM connected to a PC that's running AutoIt automation. Alternative is to use VNC but that's kind of slow & requires installing VNC.
Is there any other workaround besides modifying code or using VNC or not locking the computer?
For code changes, what can be done such that the GUI automation still executes when the computer is locked?
What my GUI automation does is to perform manual GUI config tasks as a "bot" and also does some window detection (do this if window exists, else do something else or fail).