Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

process ID

Status
Not open for further replies.
Apr 27, 1999
705
US
Hello,

Is there a way to get the processID of the CMD.exe from WshShell and kill the process?

WshShell.run "cmd.exe"


Thanks in advanced.

Fengshui1998
 
Use the Exec method


It will let you see the PID or kill the exe

Dim objShell : Set objShell = CreateObject("WScript.Shell")
Dim objExec : Set objExec = objShell.Exec("cmd.exe")
WScript.Echo objExec.ProcessID
objExec.Terminate

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top