PSKill does not run from VbScript
- by David
We have a site on our local IIS6 Windows 2003 server that occasionally locks up, and we would like a VbScript to kill the process. It is located in the system32 folder. I'm running these tests on the local machine.
For simplicity, my VbScript file simply has lines such as these:
WScript.Echo "PSKill.exe " & W3WP.ProcessId
WshShell.Run "PSKill.exe " & W3WP.ProcessId
WScript.Echo "Killed Process"
Obtained earlier in the script, W3WP.ProcessId contains the correct process ID. The script outputs to the screen:
PSKill.exe 6884
But the line that is supposed to execute the command does nothing.
If I type the command in, it works fine. Why does PsKill work fine when I type it, but not from VbScript?