• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
Visual Basic Developer Center
 
 
Home
 
 
Library
 
 
Learn
 
 
Downloads
 
 
Support
 
 
Community
 
 
Forums
 
 
 
Visual Basic Developer Center > Visual Basic Forums > Visual Basic General > kill explorer.exe
Ask a questionAsk a question
Search Forums:
  • Search Visual Basic General Forum Search Visual Basic General Forum
  • Search All Visual Basic Forums Search All Visual Basic Forums
  • Search All MSDN Forums Search All MSDN Forums
 

Answerkill explorer.exe

  • Monday, August 14, 2006 8:38 PMa2livelarge Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    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

    • ReplyReply
    • QuoteQuote
     

Answers

  • Wednesday, August 16, 2006 11:10 PMTimothy Ng MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Vote As Helpful
    0
    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.
    • ReplyReply
    • QuoteQuote
     

All Replies

  • Wednesday, August 16, 2006 11:32 PMahmedilyasMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    that is true, Windows will automatically restart explorer.

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

    • ReplyReply
    • QuoteQuote
     
  • Thursday, August 17, 2006 7:57 AMweirdbeardmt Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Windows without Explorer is like a car without wheels...
    • ReplyReply
    • QuoteQuote
     
  • Monday, August 21, 2006 12:42 PMMehshan Mustafa Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    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.

    • ReplyReply
    • QuoteQuote
     
  • Monday, August 21, 2006 1:14 PMahmedilyasMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    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
    • ReplyReply
    • QuoteQuote
     
  • Sunday, August 27, 2006 1:20 PMa2livelarge Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    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.

    • ReplyReply
    • QuoteQuote
     
  • Monday, October 23, 2006 2:35 AMskydiver1020 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    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.
    • ReplyReply
    • QuoteQuote
     
  • Thursday, August 02, 2007 7:39 PMD. Choquette Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    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.

     

     

    • ReplyReply
    • QuoteQuote
     
  • Wednesday, December 05, 2007 3:08 AMCrezzy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    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..
    • ReplyReply
    • QuoteQuote
     
Need Help with Forums? (FAQ)
 
© 2009 Microsoft Corporation. All rights reserved.
Terms of Use
|
Trademarks
|
Privacy Statement