Jump to content

Script that runs when logged in fails when under Task Manager


Recommended Posts

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.

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

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...