Sign in to follow this  
Followers 0
Harlan Witherspoon

Script that runs when logged in fails when under Task Manager

4 posts in this topic

Please forgive this utter newbie, but I's lost.

I wrote and compiled a script that:

1. Uses FileOpen and FileWriteLine to record its actions in a log file

2. Employes User-Defined functions to do its job:

3. Launches a GUI application and performs some actions upon it.

This script works when I'm logged in to the Windows 2003 SP1 server --even while using Terminal Services.

However, I simply cannot get it to work when called from a batch file launched from Task Manager.

Incredibly, even FireWriteLine() statements at the very beginning of the script fail. FileOpen() is executed, because I see a zero-length file. The executable appears to hang after launching the GUI app, perhaps on a WinWaitActive() command.

Was I hoping beyond reason that it would work when run from Task Manager?

Particulars:

a. Batch file runs as follows: start /wait cmd /c MyAutoIt3Script.exe %PARAM1% %PARAM2%

b. Logged in as a local administrator on the machine.

c. The same user can run successfully while logged in via Terminal Services.

Any help would be greatly appreciated. I'm trying to automate a nightly backup on a production system which does not have a command-line utlity of its own.

Thanks in advance.

Share this post


Link to post
Share on other sites



As far as I know, Win...() and other interactive commands will not work on a locked workstation or computer on which nobody is logged on....

This is correct. The Windows security architecture allows the running of applications in the background, but prevents interactive events such as simulated keystrokes and mouse clicks from being sent when the workstation is locked or the user is logged off.

Which begs the question:

Does AutoIt provide some kind of tool to log in a specified user to the console session? Say, something running as an NT service, the way AutoMate 6 does?

Thanks,

Share this post


Link to post
Share on other sites

I had a similar issue when I was setting up compiled scripts on a Win 2003 server. We ended up setting them up in the task scheduler to run as the domain admin. Since then they have been running without any issues.


- Kevin

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