欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

vbs在网页中显示服务

程序员文章站 2022-06-23 21:10:37
strcomputer = "." set objexplorer = wscript.createobject("internetexplorer.applicatio...

strcomputer = "."

set objexplorer = wscript.createobject("internetexplorer.application")
objexplorer.navigate "about:blank"  
objexplorer.toolbar = 0
objexplorer.statusbar = 0
objexplorer.visible = 1

set objwmiservice = getobject _
    ("winmgmts:\\" & strcomputer & "\root\cimv2")
set colitems = objwmiservice.execquery _
  ("select * from win32_service")

for each objitem in colitems
    strhtml = strhtml & objitem.displayname  & " = " & objitem.state & "<br>"
next

objexplorer.document.body.innerhtml = strhtml