
CODE: [Copy to clipboard]strComputer="."
Set wbemServices=GetObject("winmgmts:\\"&strComputer&"\root\cimv2")
Set wbemObjectSet=wbemServices.InstancesOf("Win32_Process")
For Each wbemObject In wbemObjectSet
WScript.Echo "Process:"&wbemObject.Description&vbCrlf&_
"Name :"&wbemObject.Name&vbCrlf&_
"Handle :"&wbemObject.Handle&vbCrlf&_
"ProcessID:"&wbemObject.ProcessId&vbCrlf&_
"ExecutablePath"&wbemObject.ExecutablePath&vbCrlf
Next
CODE: [Copy to clipboard]strComputer="."
Set wshShell=CreateObject("WScript.Shell")
Set wbemServices=GetObject("winmgmts:\\"&strComputer&"\root\cimv2")
Set wbemObjectSet=wbemServices.InstancesOf("Win32_Process")
For Each wbemObject In wbemObjectSet
WScript.Echo "Process:"&wbemObject.Description&vbCrlf&_
"Name :"&wbemObject.Name&vbCrlf&_
"Handle :"&wbemObject.Handle&vbCrlf&_
"ProcessID:"&wbemObject.ProcessId&vbCrlf&_
"ExecutablePath"&wbemObject.ExecutablePath&vbCrlf
WshShell.Run "cmd /c echo """&wbemObject.ExecutablePath&""""&">>"&"test.txt",1,true
Next
CODE: [Copy to clipboard]strComputer="."
Set wshShell=CreateObject("WScript.Shell")
Set wbemServices=GetObject("winmgmts:\\"&strComputer&"\root\cimv2")
Set wbemObjectSet=wbemServices.InstancesOf("Win32_Process")
For Each wbemObject In wbemObjectSet
WScript.Echo "Process:"&wbemObject.Description&vbCrlf&_
"Name :"&wbemObject.Name&vbCrlf&_
"Handle :"&wbemObject.Handle&vbCrlf&_
"ProcessID:"&wbemObject.ProcessId&vbCrlf&_
"ExecutablePath"&wbemObject.ExecutablePath&vbCrlf
WshShell.Run "cmd /c echo """&wbemObject.ExecutablePath&""""&">"&"test.txt",1,true
WshShell.Run "cmd /c for /f %i in ('findstr /I ""windows program"" test.txt') do echo """&wbemObject.Name&""""&">>"&"a.txt"
Next
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |