strComputer="."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcessList=objWMIService.ExecQuery ("select * from Win32_Process where Name='WScript.exe' ")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
我实现的是结束WScript,用于写VBS脚本测试时使用,可以把'WScript.exe' 替换成
我们需要的进程名。根据实际情况添加修改!