Tuesday, January 19, 2010

VBScript for Killing a task remotely

Killing a task using PSKill.exe, a free utility from Sysinternals.

Option explicitOn error resume next
Dim localuser, text, WshNetwork,oShell, x, y
x=InputBox("Enter Computer:")y=InputBox("Enter Process to Kill:")
Set WshNetwork = WScript.CreateObject("WScript.Network")set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "pskill.exe -t \\" & x & " " & y
MsgBox y & " killed!"

No comments:

Post a Comment