Jump to content
Sign in to follow this  
adbarads

How to close AutoIT script automatically after it hangs for 1 hour?

Recommended Posts

adbarads

Hi,

I currently have a AutoIT script that installs a Firefox plugin. Sometimes my AutoIT script hangs, due to bad builds of the Firefox plugin.

Because I have the entire process automated, and it runs overnight. Sometimes, the AutoIT script will hang all night until I notice it in the morning.

I was wondering if there was any possible way to have the AutoIT script just close itself out after a certain period of time?

Thanks.

Share this post


Link to post
Share on other sites
November

Hi there,

Try AdlibRegister.

Cheers and welcome aboard


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites
JLogan3o13

In addition to what November pointed out, how about posting your script along with where it hangs? Depending on the nature of the hang (simple wait vs. hard stop), how you handle it will vary.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
jdelaney

Does it hang because it crashes from some error, or does the execution take too long, or something else?

If execution is too long, then adlib...() will work.  If your script blows up, it won't.

There are additional levels of abstraction, but I'd execute the script via another script, and if the process takes longer than X amount of time, kill the process.

This works for if the script is stuck in some loop, or if the script blows up during execution:

$iTimer = TimerInit()
$iMax = 1000*60*60 ; 1 hour
$iPID = Run("YourCompiledAU3.exe /ErrorStdOut your paramms go here")
While ProcessExists($iPID) And TimerDiff($iTimer) < $iMax
    Sleep(20000)
WEnd

If ProcessExists($iPID) Then
    ProcessClose($iPID)
    Exit 1
Else
    Exit 0
EndIf
Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

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  

×