Jump to content

Program Timeout


Recommended Posts

Group,

I'm looking for a way to time out my script and close "myfile.exe" if it runs longer than 4 mins after executaion. Reason being is that "myfile.exe" runs every 5 mins and I don't wont to have two "myfile.exe" process running at the sametime.

Link to comment
Share on other sites

Thanks,

What I'm looking for is...to close "myfile.exe" after 4 min. I just started using autoIt and not sure what kind of function would look like if i implited this task.

Edited by ch00sen1
Link to comment
Share on other sites

This one will kill itself after 4 minutes...

Local $msg

GUICreate("My GUI") ; will create a dialog box that when displayed is centered
GUISetState(@SW_SHOW) ; will display an empty dialog box

AdlibRegister("_AutoExit", 1000 * 60 * 4)

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()

Func _AutoExit()
    Exit (1)
EndFunc   ;==>_AutoExit
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...