Jump to content

Scripts that won't exit cleanly


Recommended Posts

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
Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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