kill explorer.exe<b><font size=2></b></font><font color="#0000ff" size=2><font size=2> <p>I can use task manager to kill explorer.exe, case use following code to restart it</p> <p>Process.Start(</font><font color="#800000" size=2>&quot;explorer.exe&quot;</font><b><font size=2>)</p> <p> </p> <p> </p> <p>But why doesn't the following code kill it? It seems to kill it for a brief second, than it automaticaly start back up?</b></font></p> <p>Dim</font><b><font size=2> myProcesses() </b></font><font color="#0000ff" size=2>As</font><b><font size=2> Process</font></b></p> <p><b><font size=2></b></font><font color="#0000ff" size=2>Dim</font><b><font size=2> myProcess </b></font><font color="#0000ff" size=2>As</font><b><font size=2> Process</p></b><b> <p>myProcesses = Process.GetProcesses()</p></b><b> <p></b></font><font color="#0000ff" size=2>For</font><b><font size=2> </b></font><font color="#0000ff" size=2>Each</font><b><font size=2> myProcess </b></font><font color="#0000ff" size=2>In</font><b><font size=2> myProcesses</p> <p></b></font><font color="#0000ff" size=2>If</font><b><font size=2> myProcess.MainModule.ModuleName = </b></font><font color="#800000" size=2>&quot;explorer.exe&quot;</font><b><font size=2> </b></font><font color="#0000ff" size=2>Then</p></font><b><font size=2> <p>myProcess.Kill()</p> <p></b></font><font color="#0000ff" size=2>Exit</font><b><font size=2> </b></font><font color="#0000ff" size=2>For</p></font><b><font size=2> <p></b></font><font color="#0000ff" size=2>End</font><b><font size=2> </b></font><font color="#0000ff" size=2>If</p></font><b><font size=2> <p></b></font><font color="#0000ff" size=2>Next</p></font>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Zf414c8d2-34a0-47d7-90e3-826e555149c2http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#f414c8d2-34a0-47d7-90e3-826e555149c2http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#f414c8d2-34a0-47d7-90e3-826e555149c2a2livelargehttp://social.msdn.microsoft.com/Profile/en-US/?user=a2livelargekill explorer.exe<b><font size=2></b></font><font color="#0000ff" size=2><font size=2> <p>I can use task manager to kill explorer.exe, case use following code to restart it</p> <p>Process.Start(</font><font color="#800000" size=2>&quot;explorer.exe&quot;</font><b><font size=2>)</p> <p> </p> <p> </p> <p>But why doesn't the following code kill it? It seems to kill it for a brief second, than it automaticaly start back up?</b></font></p> <p>Dim</font><b><font size=2> myProcesses() </b></font><font color="#0000ff" size=2>As</font><b><font size=2> Process</font></b></p> <p><b><font size=2></b></font><font color="#0000ff" size=2>Dim</font><b><font size=2> myProcess </b></font><font color="#0000ff" size=2>As</font><b><font size=2> Process</p></b><b> <p>myProcesses = Process.GetProcesses()</p></b><b> <p></b></font><font color="#0000ff" size=2>For</font><b><font size=2> </b></font><font color="#0000ff" size=2>Each</font><b><font size=2> myProcess </b></font><font color="#0000ff" size=2>In</font><b><font size=2> myProcesses</p> <p></b></font><font color="#0000ff" size=2>If</font><b><font size=2> myProcess.MainModule.ModuleName = </b></font><font color="#800000" size=2>&quot;explorer.exe&quot;</font><b><font size=2> </b></font><font color="#0000ff" size=2>Then</p></font><b><font size=2> <p>myProcess.Kill()</p> <p></b></font><font color="#0000ff" size=2>Exit</font><b><font size=2> </b></font><font color="#0000ff" size=2>For</p></font><b><font size=2> <p></b></font><font color="#0000ff" size=2>End</font><b><font size=2> </b></font><font color="#0000ff" size=2>If</p></font><b><font size=2> <p></b></font><font color="#0000ff" size=2>Next</p></font>Mon, 14 Aug 2006 20:38:22 Z2006-08-17T05:08:43Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#c96b288c-5352-4243-b571-d47a41c768a7http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#c96b288c-5352-4243-b571-d47a41c768a7Timothy Ng MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Timothy%20Ng%20MSFTkill explorer.exeI believe that explorer automatically restarts when you kill it programmatically. Only when you do it through the task list does it not restart.<br><br>http://blogs.msdn.com/jeffdav/archive/2004/07/22/191636.aspx has a little bit of detail, in the comments as well.<br>Wed, 16 Aug 2006 23:10:07 Z2006-08-17T05:08:43Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#a768a5b5-ae17-4b84-b6d2-34d927a12795http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#a768a5b5-ae17-4b84-b6d2-34d927a12795ahmedilyashttp://social.msdn.microsoft.com/Profile/en-US/?user=ahmedilyaskill explorer.exe<p>that is true, Windows will automatically restart explorer.</p> <p>Question is - why on earth do you wish to kill explorer?</p>Wed, 16 Aug 2006 23:32:40 Z2006-08-16T23:32:40Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#e2630095-32bd-4cfb-aac1-b4363f2fd067http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#e2630095-32bd-4cfb-aac1-b4363f2fd067weirdbeardmthttp://social.msdn.microsoft.com/Profile/en-US/?user=weirdbeardmtkill explorer.exeWindows without Explorer is like a car without wheels...Thu, 17 Aug 2006 07:57:38 Z2006-08-17T07:57:38Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#fe2d0e39-9f9b-42c5-b705-bffd91bac909http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#fe2d0e39-9f9b-42c5-b705-bffd91bac909Mehshan Mustafahttp://social.msdn.microsoft.com/Profile/en-US/?user=Mehshan%20Mustafakill explorer.exe<p>I was trying to do the same and found a work-arround. Using the registry editor change</p> <p><strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell</strong></p> <p>to something other value than  &quot;explorer.exe&quot;. Use Kill or TerminateProcess to shutdown explorer and it won't come back again.</p>Mon, 21 Aug 2006 12:42:07 Z2006-08-21T12:42:07Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#8e3ba30b-4b7f-4465-948b-54c98f3d8f7fhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#8e3ba30b-4b7f-4465-948b-54c98f3d8f7fahmedilyashttp://social.msdn.microsoft.com/Profile/en-US/?user=ahmedilyaskill explorer.exeyou 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 undesirableMon, 21 Aug 2006 13:14:53 Z2006-08-21T13:14:53Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#3f9029d2-af24-46b5-90a8-e424b97d389fhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#3f9029d2-af24-46b5-90a8-e424b97d389fa2livelargehttp://social.msdn.microsoft.com/Profile/en-US/?user=a2livelargekill explorer.exe<p>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....</p> <p>My client gave me that direction, I believe he is using somthing like a &quot;TweakUI&quot; to do somthing similiar elsewhere.</p>Sun, 27 Aug 2006 13:20:36 Z2006-08-27T13:20:36Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#50393578-e030-449a-a342-4b0c072255f3http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#50393578-e030-449a-a342-4b0c072255f3skydiver1020http://social.msdn.microsoft.com/Profile/en-US/?user=skydiver1020kill explorer.exeWhy does Explorer continue to search beyond the folder selected and will not stop if the &quot;STOP&quot; button is clicked?  It apears to serch the entire computer for every search occupying 45 to 55 CPU time.Mon, 23 Oct 2006 02:35:12 Z2006-10-23T02:35:12Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#b795b869-bed6-47dc-92f3-b0f95db40253http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#b795b869-bed6-47dc-92f3-b0f95db40253D. Choquettehttp://social.msdn.microsoft.com/Profile/en-US/?user=D.%20Choquettekill explorer.exe<p><font face="Times New Roman">I also agree that this is not something you usually want to do but sometimes you have to.</font></p> <p align=left><font face="Times New Roman">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:</font></p> <p align=left><font face="Times New Roman">&gt;TASKKILL /F /IM explorer.exe</font></p> <p align=left><font face="Times New Roman"></font> </p> <p align=left><font face="Times New Roman">Just declare a process to silently execute task kill </font></p> <p align=left><font face="Times New Roman"></font> </p><font color="#008000" size=2> <p>//create a process start info to execute the task kill program</p></font><font size=2> <p></font><font color="#008000" size=2>//this is needed because otherwise explorer is restarted automatically by windows</p></font><font size=2> <p></font><font color="#2b91af" size=2>ProcessStartInfo</font><font size=2> taskKill = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#2b91af" size=2>ProcessStartInfo</font><font size=2>(</font><font color="#a31515" size=2>&quot;taskkill&quot;</font><font size=2>, </font><font color="#a31515" size=2>&quot;/F /IM explorer.exe&quot;</font><font size=2>);</p> <p></font><font color="#008000" size=2></font> </p> <p align=left><font color="#008000" size=2>//hide the command prompt from the user</p></font><font size=2> <p>taskKill.WindowStyle = </font><font color="#2b91af" size=2>ProcessWindowStyle</font><font size=2>.Hidden;</p> <p></font><font color="#008000" size=2></font> </p> <p align=left><font color="#008000" size=2>//create a new process</p></font><font size=2> <p></font><font color="#2b91af" size=2>Process</font><font size=2> process = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#2b91af" size=2>Process</font><font size=2>();</p> <p></font><font color="#008000" size=2></font> </p> <p align=left><font color="#008000" size=2>//set the process start info</p></font><font size=2> <p>process.StartInfo = taskKill;</p> <p></font><font color="#008000" size=2></font> </p> <p align=left><font color="#008000" size=2>//start the process</p></font><font size=2> <p>process.Start();</p> <p></font><font color="#008000" size=2></font> </p> <p align=left><font color="#008000" size=2>//wait until the task kill process is done</p></font><font size=2> <p>process.WaitForExit();</p></font> <p align=left><font face="Times New Roman"></font> </p> <p align=left><font face="Times New Roman"></font> </p> <p align=left><font face="Times New Roman"></font> </p> <p align=left><font face="Times New Roman">See also</font></p> <p align=left><font face="Times New Roman">&gt;TASKKILL /?</font></p> <p align=left><font face="Times New Roman">for other command line parameters.</font></p> <p align=left><font face="Times New Roman"></font> </p> <p align=left><font face="Times New Roman">Dom.</font></p> <p align=left> </p> <p align=left><font face=Arial size=2></font> </p>Thu, 02 Aug 2007 19:39:02 Z2007-08-02T19:39:02Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#449b16b0-7ab5-4802-8846-9903ab794b2dhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/f414c8d2-34a0-47d7-90e3-826e555149c2#449b16b0-7ab5-4802-8846-9903ab794b2dCrezzyhttp://social.msdn.microsoft.com/Profile/en-US/?user=Crezzykill explorer.exeI am also trying to kill explorer. However my scenario is a little different..<br><br>I have completely removed internet explorer from program files\<br>and have removed explorer from windows\<br>and windows\dllcache<br><br>However when I Run a command like c:\folder<br>explorer shows back up...<br><br>how is this possible?<br><br>also I have disabled windows file protection too..<br>Wed, 05 Dec 2007 03:08:14 Z2007-12-05T03:08:14Z