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.

9 Responses to “Windows XP/Vista: Use a Batch File for Quickly Restarting explorer.exe”

  1. December 11, 2008 at 6:39 am, FloJo said:

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

    Reply

  2. September 21, 2009 at 4:41 pm, Anonymous said:

    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?

    Reply

  3. August 08, 2010 at 3:12 pm, Eight8rooney4ever said:

    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”

    Reply

  4. March 11, 2011 at 9:55 pm, noworkie said:

    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?

    Reply

  5. November 15, 2012 at 7:58 am, Patrik said:

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

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

    Reply

  6. December 06, 2012 at 3:57 pm, Hossein said:

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

    Reply

    • February 07, 2013 at 10:51 am, AA HH said:

      Awesome, thanks for the Win7 update!

      Reply

  7. June 24, 2013 at 9:54 am, George said:

    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

    Reply

  8. October 24, 2013 at 9:50 am, Mark Hunter said:

    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.

    Reply

Leave a Reply