Board logo

标题: VBS列举远程主机进程列表 [打印本页]

作者: youxi01    时间: 2007-11-5 20:10     标题: VBS列举远程主机进程列表

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





欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2