Windows XP/Vista: Use a Batch File for Quickly Restarting explorer.exe

Explorer.exe is the user shell on your Windows system (taskbar, desktop, etc.) and periodically it requires a restart to resume proper functionality. Additionally, if you do a lot of tweaking to your system registry like I do, it’s much easier to restart explorer.exe to reload the registry instead of restarting the entire system. By creating a .bat file, you will have a quick 2 step solution that will restart explorer.exe and get you back to computing in just a few seconds.


1. Open Notepad.

2. Copy and paste the following into the new document:@echo off
taskkill /f /IM explorer.exe
explorer.exe

3. Save your document with a descriptive name such as restart_explorer.bat. Make sure to save the file with the .bat extension and not .txt.

The next time you need to restart explorer.exe, simply run the newly created .bat file and close the command window that appears.

 

About Rob Rogers

Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.
View more articles by Rob Rogers

The Conversation

Follow the reactions below and share your own thoughts.

  • FloJo

    Or Task Manager > Applications > New Task > explorer.exe

  • Anonymous

    Ran batch file and it now opens the “Windows Explorer” instead of restarting “Explorer” (desktop). It used to restart Explorer as described in your post. I checked the batch file and it is exactly the same as copied from you post. Any suggestions?

  • Eight8rooney4ever

    The “Taskkill” command is not Recognize in Windows XP
    that’s the problem
    and it skips this step and run explorer.exe
    that’s why it open “Windows Explorer”

  • noworkie

    doesn’t work in win7. as stated above it brings up windows explorer (i.e. “my documents”) and leaves the explorer.exe desktop closed.
    manually typing explorer.exe in a cmd prompt brings it back up, but explorer.exe in a batch file doesn’t work. any solutions?

  • Patrik

    There was a missing new line. Following works on Windows 7.

    @echo off
    taskkill /f /IM explorer.exe
    explorer.exe

  • Hossein

    try this
    @echo off
    taskkill /f /IM explorer.exe
    explorer.exe

    • AA HH

      Awesome, thanks for the Win7 update!

  • George

    To prevent the command window from showing “SUCCESS: The process “explorer.exe” with PID # has been terminated,” use the following:

    @echo off
    taskkill /f /IM explorer.exe
    start “” explorer.exe

  • Mark Hunter

    This works even better, as it does leave a dangling cmd window:

    @echo off
    taskkill /f /IM explorer.exe
    explorer.exe
    exit

    Hope that helps.