Elmer

Extraordinary Member
Joined
Mar 5, 2010
Messages
3,864
If you're into modifying system files etc. you'll soon get fed up of logging out/in or using Task Manager to stop and re-start Explorer.exe all the time. Even if Explorer has died and you can r-click the desktop this will save you logging out/in or launching Task Manager (Ctrl+Alt+Delete).

Here's the handy alternative:-

How to Kill and Revive Explorer.exe using the Context Menu.

First, make yourself a .bat file (make a New Text Document.txt, then when you save it change .txt file extension to .bat) and call it KILL EXPLORER OR WHATEVER YOU WANT.bat, enter this text code and save :-
Code:
@echo off

taskkill /f /im explorer.exe
sleep [B]4[/B]
start explorer.exe
The 4 is adjustable, giving a slight sleep (4 is 3 secs, 6 is 5 secs, 2 is 1 secs etc. 1 is 0 secs but it makes your monitor look like it's popping!!(not advisable!)).
Then make yourself a .reg file (as per the New Text Document.txt above), call it KILL EXPLORER OR WHATEVER YOU WANT.reg and enter this text code and save it:-
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\Restart Explorer]
@="Kill Explorer or whatever you want here to show in context menu"
"Icon"="An:\\optional\\path to\\add a 16x16.ico"
"Position"="Top"

[HKEY_CLASSES_ROOT\Directory\Background\shell\Restart Explorer\command]
@="The:\\path\\to your\\KILL EXPLORER OR WHATEVER YOU WANT.BAT"
Click and merge the .reg file into your registry.

Then in the background empty space of any Folder or your Desktop you will be able to right click and you will have an "Explorer Kill Switch" at the top of your context menu.

ExplorerKill.png


Hope that's of use to somebody. It's assisted me, oooh, lost count of the times!
 

Last edited:
Solution
This is a helpful guide on creating a context menu option to quickly kill and restart Explorer.exe without the need to log out/in or use Task Manager. Here's a breakdown of the steps involved:

How to Kill and Revive Explorer.exe using the Context Menu:​

Creating the .bat file:​

  1. Create a new text document and save it with a .bat extension (e.g., KILL_EXPLORER_OR_WHATEVER_YOU_WANT.bat).
  2. Add the following code inside the .bat file:
    Code:
    @echo off taskkill /f /im explorer.exe timeout /t 4 /nobreak > nul start explorer.exe
    • The number after /t in timeout /t represents the time in seconds to wait before restarting Explorer.exe.

      Creating the .reg file:​

    []Create another text document and...
This is a helpful guide on creating a context menu option to quickly kill and restart Explorer.exe without the need to log out/in or use Task Manager. Here's a breakdown of the steps involved:

How to Kill and Revive Explorer.exe using the Context Menu:​

Creating the .bat file:​

  1. Create a new text document and save it with a .bat extension (e.g., KILL_EXPLORER_OR_WHATEVER_YOU_WANT.bat).
  2. Add the following code inside the .bat file:
    Code:
    @echo off taskkill /f /im explorer.exe timeout /t 4 /nobreak > nul start explorer.exe
    • The number after /t in timeout /t represents the time in seconds to wait before restarting Explorer.exe.

      Creating the .reg file:​

    []Create another text document and save it with a .reg extension (e.g., KILL_EXPLORER_OR_WHATEVER_YOU_WANT.reg). []Add the following code inside the .reg file:
    Code:
    Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\Restart Explorer] @="Kill Explorer or whatever you want here to show in context menu" "Icon"="An:\\optional\\path to\\add a 16x16.ico" "Position"="Top" [HKEY_CLASSES_ROOT\Directory\Background\shell\Restart Explorer\command] @="The:\\path\\to your\\KILL_EXPLORER_OR_WHATEVER_YOU_WANT.BAT"
    • Customize the values accordingly:
      • Replace [COLOR=Red] placeholders with your desired text or paths.
      • Adjust the "Icon" key to point to an optional icon path.
      • Update the "@=" key with the text you want to display in the context menu.
      • Set the "@=" key with the path to your .bat file.

        Applying the context menu:​

    []Merge the .reg file into your registry by double-clicking and confirming the merge action. []Right-clicking on the empty space of any folder or your desktop will now display the "Explorer Kill Switch" option at the top of the context menu. This quick context menu option can be a time-saver for restarting Explorer.exe efficiently. Thank you for sharing this useful tip!
 

Solution
Back
Top