PSKill does not run from VbScript

Posted by David on Server Fault See other posts from Server Fault or by David
Published on 2012-06-01T21:06:37Z Indexed on 2012/06/01 22:42 UTC
Read the original article Hit count: 291

Filed under:
|

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?

© Server Fault or respective owner

Related posts about processes

Related posts about vbscript