Hakuji Posted July 11, 2006 Share Posted July 11, 2006 Hi... i would to create a simple anticrash application that restart an exe if it isn't running. like "if notepad.exe is not running then run notepad.exe" i tried this: while 1 if WinActive("Blocco Note") Then $d=1 Else Run("notepad.exe") endif wend But this opens Notepad alse if it is open. Bye Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 11, 2006 Share Posted July 11, 2006 HI, try something like While 1 Sleep(200) _checkForRunningApp("notepad.exe", "notepad.exe") WEnd Func _checkForRunningApp($s_App, $AppPath) If ProcessExists($s_App) = 0 Then Run($AppPath) EndIf EndFunc So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Briegel Posted July 12, 2006 Share Posted July 12, 2006 Another possibility is using 'AdlibEnable()'. AdlibEnable("_CheckNotepad") ; look at helpfile for timer settings While 1 Sleep(100) WEnd Func _CheckNotepad() If ProcessExists("notepad.exe") = 0 Then Run("notepad.exe") EndFunc Link to comment Share on other sites More sharing options...
Hakuji Posted July 12, 2006 Author Share Posted July 12, 2006 Thousand Thanks guys. I know this is a very simple script but i don't know every command of autoit and i think it is very usefull for many programs Bye. Thanks again. Hakuji 8) 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