- Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate, (debug)}!\\.\root\cimv2")
- Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'cmd.exe'")
- for each proc in colProcesses
- Set SubProcesses = objWMIService.ExecQuery("Select * from Win32_Process Where ParentProcessId=" & proc.ProcessId)
- for each SubProc in SubProcesses
- 'WScript.echo SubProc.Name
- SubProc.Terminate
- next
- next
复制代码
|