标题: VBS列举远程主机进程列表 [打印本页]
作者: youxi01 时间: 2007-11-5 20:10 标题: VBS列举远程主机进程列表
- 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
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |