I have a serious problem with windows booting up - the ony way i have found to stop a painfully long boot up process is to kill the explorer.exe process and then restart it. I want to automate this, executing a new instance of explorer.exe is easy but i am having problems killing the process to begin with.
How can i get the process identifier for explorer.exe?
Or is there a way to terminate the process using its name and not by PID?
On Windows XP:
Other methods for killing a process from code.
taskkill /im explorer.exe
I tried runing taskkill from the CL before coding it but get the unrecognised command error. Taskkill is not compatible with the the OS. (http://www.annoyances.org/exec/show/article10-002)
Can anyone suggest a solution?
You can use an API route, but if you have WinXP then you should have WMI installed
Save as "KillExplorer.js" run it when you want explorer killed. You can run it from the commandline with "cscript KillExplorer.js"
var strQry = "SELECT * FROM Win32_Process WHERE Name=\"explorer.exe\"";
var oExp = new Enumerator(GetObject("WinMgmts:").ExecQuery(strQry));