问题描述
- asp使用wmi获取本地服务信息不成功
-
strComputer = "." Set objSWbemServices = GetObject("winmgmts:\" & strComputer & "rootCIMV2") Set objSWbemObjectSet = objSWbemServices.ExecQuery("SELECT * FROM Win32_Service",,48)
For Each objSWbemObject in objSWbemObjectSet
response.Write objSWbemObject.displayname + "
"
response.Write objSWbemObject.state + "
"
Next输出为空,但在WMICodeCreator.exe里运行是输出成功的
解决方案
asp权限是否不够。
解决方案二:
应该是权限不够,配置iis一administrator用户运行你的网站
要不就存为vbs文件,修改response.write为msgbox,server.createobject去掉前面的server.
时间: 2024-12-08 05:33:30