Restarting Explorer

Comments

9 comments

  • Luke Nichols

    It could be having a problem because it's trying to start explorer too soon after killing it. Try adding a pause in between:

     

    taskkill /im explorer.exe /f

    timeout /t 3 /nobreak

    start explorer.exe

    0
    Comment actions Permalink
  • Anthony Carver

    This is the output I received,

    SUCCESS: The process "explorer.exe" with PID 4320 has been terminated.
    ERROR: Input redirection is not supported, exiting the process immediately.

    0
    Comment actions Permalink
  • Robert Basil

    From your error it looks like the startup process is trying to startup explorer while it's still in the process of shutting down.

    The timeout suggested by Luke above should work for you.

    0
    Comment actions Permalink
  • Luke Nichols

    When I tested my suggestion I got the same input redirection error as Anthony. When I took out the timeout portion that error went away. I'm not sure why it's having an issue with that, maybe try taking out the /nobreak switch?

    0
    Comment actions Permalink
  • Anthony Carver

    Got the same error when taking out /nobreak

    SUCCESS: The process "explorer.exe" with PID 7720 has been terminated.
    SUCCESS: The process "explorer.exe" with PID 7612 has been terminated.
    ERROR: Input redirection is not supported, exiting the process immediately.

    0
    Comment actions Permalink
  • Stephen Valdinger

    What? No powershell?

     

    Get-Process explorer | Stop-Process

    This kills explorer on my machine, and it instantly recovers when it quits.

    1
    Comment actions Permalink
  • Robert Basil

    That's weird, I'll see if I have a chance to test some stuff later this afternoon.

    0
    Comment actions Permalink
  • Robert Basil

    Oh wait, just realized you are talking about Explorer and not Internet Explorer. DOH!

    Powershell for the win! :-)

    0
    Comment actions Permalink
  • Luke Nichols

    Yes, is PowerShell an option? You should just be able to do this command in PowerShell, which I confirmed as working on Windows 10 1709 x64 but might not work on W7:

    stop-process -ProcessName explorer

    It also automatically starts the process again afterward.

    0
    Comment actions Permalink

Please sign in to leave a comment.