1、vmi工具安装,使用ie打开(如图)or C:\Documents and Settings\Administrator\桌面\VBS>wbemtest.exe:
2、跟进工具查看的对象及其属性编写代码测试:
setcomputer = "."
set wbemservices = getobject("winmgmts:\\" & strcomputer)
set wbemobjectset = wbemservices.instancesof("win32_process")
for each wbemobject in wbemobjectset
'createobject("scripting.filesystemobject").createtextfile("1.txt",true).write wbemobject.name
wscript.echo "P_NAME:" & wbemobject.name &"---------------"& "P_PID:" & wbemobject.handle &"---------------"& wbemobject.ThreadCount
'wscript.echo "process-handle:" & wbemobject.handle
'wscript.echo "process-installdate:" & wbemobject.installdate
'wsh.echo "process-name:" & wbemobject.name
next
3、运行是在cmd中运行: