Opened 14 years ago

Closed 14 years ago

#1732 closed Bug (No Bug)

Compiled script gets terminated when running interactively under SYSTEM account and user logs off

Reported by: Jim Dandy Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


I just recently upgraded from AutoIt to (yes, I know I was behind the times). The application I had been working on runs as an interactive service running under the SYSTEM account. Part of the script is to log off the currently logged on user then perform other actions after the logoff is complete. When I ran the script that was compiled under, the script survived the logoff event just fine, however, when compiled with, the script would terminate at user logoff.

I had read several forum posts regarding the WM_QUERYENDSESSION mesasage that is sent to each top level window during logoff and had incorporated my own GUIRegisterMsg function to try to compensate for this, but the function that handled this event only delayed the inevitable termination of the script.

I have not read anything in any of the changelog entries that refer to the changing of this behavior on purpose, so I belive this to be a bug.

To test this, the following code can be compiled with any version of AutoIt higher than

#include <GUIConstantsEx.au3>
$Form1 = GUICreate("AutoIt Version: " & @AutoItVersion, 415, 165, 192, 124)
$Label1 = GUICtrlCreateLabel("This script is running in the context of the account: " & @UserName, 32, 64, 328, 17)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg

The script does not need to be run as a service, as long as it runs under the SYSTEM account and running interactively with the logged on user; so scheduling the script to run using the AT command will work using the following command: AT 'time' /interactive 'Path to script'\'ScriptName'

Once the script launches, perform a logoff, then log back on to windows. You will notice that the script will have terminated. If the same script is compiled with version and run interactively from the SYSTEM account, the GUI window will still be there waiting for you when you log back on.

I do have a workaround for this issue; I just compile the script using, but I would love for it to behave in this way in future versions and not be relegated to using a 2+ year old version.

Please note that I have tried this with every major version from to and version was the last version that was able to behave in this manner.

Attachments (0)

Change History (4)

comment:1 Changed 14 years ago by Jpm

Under which os are you running just use _DebugBugReportEnv() to report info
I may be a .manifest change

comment:2 Changed 14 years ago by Jpm

  • Owner set to Jon
  • Status changed from new to assigned

comment:3 Changed 14 years ago by Jim Dandy

After some further investigation, it appears that the only version that behaves in this manner is and it only does this on Windows XP SP2. With XP SP3, the script terminates at logoff regardless of the version of AutoIt.

I believe that the behavior of the script not terminating when running interactively under the SYSTEM account is purely aberrational and only happens with the version of AutoIt running on XP SP2.

I appreciate you looking into this and apologize for wasting your time. Apparently, this behavior is normal and "expected", and for it to not do that is an anomaly.

comment:4 Changed 14 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from assigned to closed

no problem
Thanks for the diagnostic

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jon.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.