title: vbscript- explorer process restored automatically after kill
body: <p>I've used the below script a couple of times to kill processes in a vbscript without any issues. </p>
  
  <p>This time I'm trying to kill explorer.exe. Only issue is after I use the script to kill explorer.exe within 2 seconds explorer process restores.</p>
  
  <p>I don't understand ? because if I manually kill explorer.exe with Task Manager, the process is killed until I start the process again. So whats the issue with the below script?</p>
  
  <pre><code>Option Explicit
  Dim objWMIService, objProcess, colProcess
  Dim strComputer, strProcessKill 
  strComputer = "."
  strProcessKill = "'explorer.exe'" 
  
  Set objWMIService = GetObject("winmgmts:" _
  &amp; "{impersonationLevel=impersonate}!\\" _ 
  &amp; strComputer &amp; "\root\cimv2") 
  
  Set colProcess = objWMIService.ExecQuery _
  ("Select * from Win32_Process Where Name = " &amp; strProcessKill )
  For Each objProcess in colProcess
  objProcess.Terminate()
  Next 
  
  WScript.Quit 
  </code></pre>