Jump to content
Sign in to follow this  
ch00sen1

Program Timeout

Recommended Posts

ch00sen1

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.

Share this post


Link to post
Share on other sites
KaFu
ch00sen1

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

Share this post


Link to post
Share on other sites
KaFu

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

Share this post


Link to post
Share on other sites
ch00sen1

Thanks for the help.....this worked out fine.

Is there way to only run "myfile.exe" at one time....just in case I have two running at the same time.

Thanks

Chad

Share this post


Link to post
Share on other sites
KaFu

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.