Jump to content

Recommended Posts

Posted

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

  • Developers
Posted (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 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.
  :)

Posted

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
Thanks

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
×
×
  • Create New...