Sign in to follow this  
Followers 0
Hakuji

Trying to make a simple anticrash application

4 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thousand Thanks guys. I know this is a very simple script but i don't know every command of autoit :D and i think it is very usefull for many programs :wacko:

Bye. Thanks again.

Hakuji 8)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0