ch00sen1 Posted April 1, 2010 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.
KaFu Posted April 1, 2010 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 (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
ch00sen1 Posted April 1, 2010 Author 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
KaFu Posted April 1, 2010 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 (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
ch00sen1 Posted April 1, 2010 Author 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
KaFu Posted April 1, 2010 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 (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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