beb7089 Posted November 14, 2005 Share Posted November 14, 2005 Currently on my network I have end-users with auto-it compiled exe scripts open and have the file(s) locked making it impossible for me to update these exe. What I would like to do is to include into the script a line of code that would after a given amount of time kill its own process. Say after 3mins and the script is not done, it would simply kill itself and release the file lock. Any ideas on how I would code this? I know I will need to use ProcessClose and some line of code that basically ticks away the seconds. Thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted November 14, 2005 Developers Share Posted November 14, 2005 (edited) Something like this will end your script after 3 minutes: Global $Init_Time = TimerInit() AdlibEnable("Check_Running_Time") ; your script Func Check_Running_Time() If TimerDiff($Init_Time) > 3 * 60 * 1000 Then Exit EndFunc Edited November 14, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
beb7089 Posted November 14, 2005 Author Share Posted November 14, 2005 Something like this will end your script after 3 minutes:Global $Init_Time = TimerInit() AdlibEnable("Check_Running_Time") ; your script Func Check_Running_Time() If TimerDiff($Init_Time) > 3 * 60 * 1000 Then Exit EndFuncThanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now