Sign in to follow this  
Followers 0
WorknMan

Scripts that won't exit cleanly

2 posts in this topic

#1 ·  Posted (edited)

I'm sure this has probably been brought up before, but I'm not sure what keywords to use to search for it, so ...

Sometimes, my AutoIt scripts will execute all of their code, and instead of terminating, they just keep running. There's one script in particular I have running every couple of minutes that does a few things, writes to a log file, and then exits. Well, it's supposed to exit anyway :mellow: I just checked my task monitor and there was like 20 copies of it autoit3.exe running... it's writing to the log file, which is the very last line of code in the script. I tried putting in 'Exit' explicitly, but that didn't work either.

So, I'm wondering if there's some reason why a script would hang out in memory after it's finished doing its thing?

EDIT: I forgot to mention that I've had this happen on 2 machines - one running WinXP and the other running Windows 7 x64.

Edited by WorknMan

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

What does the task monitor show? Is your script using CPU cycles? That would show that your script is running in a loop. If no CPU is used then your script might wait for something (WinWait ...).

You could use

AutoItSetOption("TrayIconDebug")
in your script so the tray icon shows the current linenumber. Unfortunately linenumbers are not displayed for compiled scripts.

Or you could use

#AutoIt3Wrapper_Run_Debug_Mode=y
so every executed script line is displayed on the SciTE console. Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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