- on error resume next
- '////code by youxi01@bbs.bathome.net
- '////早期作品;
- computer=inputbox("请输入一个存在的主机名或IP!")
- set objlocator=createobject("wbemscripting.swbemlocator")
- set obj=objlocator.connectserver(computer,"root\cimv2","administrator","")
- if cstr(err.number)="0" then
- set colprocess=obj.execquery("select * from win32_process")
- for each ps in colprocess
- jincheng=jincheng+ps.handle+vbtab+vbtab+ps.name&vbcrlf
- next
- wscript.echo "远程主机: "&computer&"上的进程如下:"&vbcrlf&vbcrlf&"PID号:"+vbtab+vbtab+"进程"+vbcrlf+jincheng
- else
- wscript.echo "发生错误,请检查!"
- end if
复制代码
|