ch00sen1 Posted April 1, 2010 Share Posted April 1, 2010 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 More sharing options...
KaFu Posted April 1, 2010 Share Posted April 1, 2010 Look up the functions AdlibRegister() or the _timers() UDF. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ch00sen1 Posted April 1, 2010 Author Share Posted April 1, 2010 (edited) 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 April 1, 2010 by ch00sen1 Link to comment Share on other sites More sharing options...
KaFu Posted April 1, 2010 Share Posted April 1, 2010 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 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ch00sen1 Posted April 1, 2010 Author Share Posted April 1, 2010 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 Link to comment Share on other sites More sharing options...
KaFu Posted April 1, 2010 Share Posted April 1, 2010 Look up the singleton() udf or take a look at the "Enforce Single Instance" udf in my signature. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) 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