AutoHotkey Community

It is currently May 26th, 2012, 9:58 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: recover_explorer.ahk
PostPosted: July 17th, 2008, 7:44 am 
Offline

Joined: January 2nd, 2008, 4:47 am
Posts: 150
Location: Freenode IRC
Code:
; recover_explorer.ahk (v1.0 | 17-July-2008 | p=208256)
; Script by Raccoon 17-July-2008
; Restarts the Explorer shell if it crashes.

#SingleInstance, force      ; force|ignore|off|(blank)
#NoTrayIcon                 ; hide trayicon

Loop
{
    Process, WaitClose, explorer.exe                        ; Wait for all instances of explorer.exe to close/crash.
    ToolTip, Explorer Crashed.`nRestarting in 3 seconds...  ; Display a message to the user.
    Process, Wait, explorer.exe, 3                          ; Wait 3 more seconds just in case something else restarts it.
    ToolTip                                                 ; Hide message.
    IfEqual, ErrorLevel, 0, Run, explorer.exe               ; Re-launch explorer.exe.  RunWait may be useful, but redundant.
}


This code can be used to restart any process that is terminated or has crashed. This example can only monitor a single process. To monitor multiple processes, you'll have to loop through a list of "Process, Exist, xyzzy.exe" and check the value of ErrorLevel after each.

_________________
Image

Need help right away? Get live support on IRC.
Already have an IRC client installed? /join #ahk


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 14th, 2008, 1:46 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Usually when explorer crashes task manager still works, so I terminate process with that. I suppose this script is useful if your windows keep hanging.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 14th, 2008, 1:50 pm 
Offline

Joined: August 20th, 2008, 4:25 pm
Posts: 256
I have something similar, i have an emergency hotkey on this. Basically, all browser hotkeys on my keyboard have a new meaning on my system.

_________________
-Chavez.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: kenn and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group