none
kill explorer.exe

    Question

  • I can use task manager to kill explorer.exe, case use following code to restart it

    Process.Start("explorer.exe")

     

     

    But why doesn't the following code kill it? It seems to kill it for a brief second, than it automaticaly start back up?

    Dim myProcesses() As Process

    Dim myProcess As Process

    myProcesses = Process.GetProcesses()

    For Each myProcess In myProcesses

    If myProcess.MainModule.ModuleName = "explorer.exe" Then

    myProcess.Kill()

    Exit For

    End If

    Next

    Monday, August 14, 2006 8:38 PM

Answers

  • I believe that explorer automatically restarts when you kill it programmatically. Only when you do it through the task list does it not restart.

    http://blogs.msdn.com/jeffdav/archive/2004/07/22/191636.aspx has a little bit of detail, in the comments as well.
    Wednesday, August 16, 2006 11:10 PM
    Moderator

All replies

  • I believe that explorer automatically restarts when you kill it programmatically. Only when you do it through the task list does it not restart.

    http://blogs.msdn.com/jeffdav/archive/2004/07/22/191636.aspx has a little bit of detail, in the comments as well.
    Wednesday, August 16, 2006 11:10 PM
    Moderator
  • that is true, Windows will automatically restart explorer.

    Question is - why on earth do you wish to kill explorer?

    Wednesday, August 16, 2006 11:32 PM
    Moderator
  • Windows without Explorer is like a car without wheels...
    Thursday, August 17, 2006 7:57 AM
  • I was trying to do the same and found a work-arround. Using the registry editor change

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell

    to something other value than  "explorer.exe". Use Kill or TerminateProcess to shutdown explorer and it won't come back again.

    Monday, August 21, 2006 12:42 PM
  • you really shouldnt be doing stuff like this, especially modifying the registry as not only will the user be unhappy but other things may also happen which could be undesirable
    Monday, August 21, 2006 1:14 PM
    Moderator
  • Designing a Kiosk type application, that has different user levels. I need to prohibit most users from messing with the windows world. But a high level login needs to have access to desktop, and programs. Stopping the explorer.exe does that exact thing. If I can programmically turn it on or off then I can control what the user has acces to while keeping the application running and not effecting all the real-time processes I am developing....

    My client gave me that direction, I believe he is using somthing like a "TweakUI" to do somthing similiar elsewhere.

    Sunday, August 27, 2006 1:20 PM
  • Why does Explorer continue to search beyond the folder selected and will not stop if the "STOP" button is clicked?  It apears to serch the entire computer for every search occupying 45 to 55 CPU time.
    Monday, October 23, 2006 2:35 AM
  • I also agree that this is not something you usually want to do but sometimes you have to.

    If you want to kill explorer programmatically without having it back again you can use an exe in c:\Windows\System32\ called taskkill and use it to kill explorer.  This way it will not come back automatically.  Use the following command line:

    >TASKKILL /F /IM explorer.exe

     

    Just declare a process to silently execute task kill

     

    //create a process start info to execute the task kill program

    //this is needed because otherwise explorer is restarted automatically by windows

    ProcessStartInfo taskKill = new ProcessStartInfo("taskkill", "/F /IM explorer.exe");

     

    //hide the command prompt from the user

    taskKill.WindowStyle = ProcessWindowStyle.Hidden;

     

    //create a new process

    Process process = new Process();

     

    //set the process start info

    process.StartInfo = taskKill;

     

    //start the process

    process.Start();

     

    //wait until the task kill process is done

    process.WaitForExit();

     

     

     

    See also

    >TASKKILL /?

    for other command line parameters.

     

    Dom.

     

     

    Thursday, August 02, 2007 7:39 PM
  • I am also trying to kill explorer. However my scenario is a little different..

    I have completely removed internet explorer from program files\
    and have removed explorer from windows\
    and windows\dllcache

    However when I Run a command like c:\folder
    explorer shows back up...

    how is this possible?

    also I have disabled windows file protection too..
    Wednesday, December 05, 2007 3:08 AM
  • to kill explorer use this code:

    System.Diagnostics.Process.Start(

    "taskkill.exe", " /f /im explorer.exe")

    Thursday, January 21, 2010 3:12 AM
  • Hello.
    I use the D Choquete  code for kill taskbar under windows 7,  is the best way and work and  no need change the register, this is exelent.

    My question now is , how make the task bark back to run, im tryng with  Process.Start("explorer.exe");

    But windows explorer is opened, and task bar never back:

    How make taskbar start work again?]]Im working con c# , i know this is visual basic forum, but f somebody can ask myquestion with c# i apreciate, i need do this on my wpf aplication.

     

     

     

    Tuesday, May 25, 2010 7:32 PM
  • I find the way to do that under widnows 7 For restart just sue: Process.Start(@"c:\windows\explorer.exe");
    • Proposed as answer by Groboto Tuesday, May 25, 2010 8:22 PM
    Tuesday, May 25, 2010 8:22 PM
  • easyest way to kill it is:

    shell("cmd.exe /c taskkill /f /im explorer.exe")

    • Edited by Bob32103 Monday, September 05, 2011 5:17 AM
    Monday, September 05, 2011 5:15 AM
  • That's very sloppy.

    Renee

    Monday, September 05, 2011 6:04 AM
  • To respond at your question:

    Question is - why on earth do you wish to kill explorer?

    For example, if you have a enterprise who get the  politic to remove all simple user from domain admin, and you are the sysadmin, your are not able to manage ADUC anymore from your user session.

    You have to use connect as with your admin account every time on each domain tools you need. Boooooring!!!

    Script who kill and restart the process explorer as your domain account in your user session will be a good reason to do that, no?  8-)

    Monday, February 04, 2013 3:05 PM
  • This thread was started six-and-a-half years ago... a search for "group policy kiosk mode windows" might be useful if you actually need to do this.

    --
    Andrew


    Monday, February 04, 2013 7:28 PM