- 阅读权限
- 150
- UID
- 48
- 帖子
- 30
- 精华
- 2
- 注册时间
- 2013-2-28
- 在线时间
- 27 小时
- UID
- 48
- 帖子
- 30
- 精华
- 2
- 注册时间
- 2013-2-28
- 在线时间
- 27 小时
|
代码,可直接复制进文本文件,然后改扩展名为 *.vbs 双击即可运行
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
On Error Resume Next
If WScript.Arguments.UnNamed.Count = 1 Then
strComputer = WScript.Arguments.UnNamed(1)
Else
strComputer = "."
End If
Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/CIMV2" )
Set colInstances = objWMIService.ExecQuery( "SELECT * FROM Win32_PnPEntity WHERE ClassGuid='{4d36e978-e325-11ce-bfc1-08002be10318}'", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly )
For Each objInstance In colInstances
stri=stri+objInstance.Caption + vbcrlf
Next
msgbox stri
|
|