VBScript根据盘符找设备名的代码
导读:收集整理的这篇文章主要介绍了VBScript根据盘符找设备名的代码,觉得挺不错的,现在分享给大家,也给大家做个参考。 复制代码 代码如下:On Error Resume NextstrC...
收集整理的这篇文章主要介绍了VBScript根据盘符找设备名的代码,觉得挺不错的,现在分享给大家,也给大家做个参考。 复制代码 代码如下:On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colITems = objWMIService.ExecQuery( _
"associators of { win32_LOGicaldisk.deviceid='G:'} WHERE ResultClass=Win32_DiskPartition")
For each obJITem in colItems
TargetIndex = objItem.DiskIndex
Set Items = objWMIService.ExecQuery( _
"SELECT * From Win32_DiskDrive Where DeviceID Like '%" & objItem.DiskIndex & "'",,48)
For Each Item in Items
Wscript.Echo "Model: " & Item.Model
Next
Next
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: VBScript根据盘符找设备名的代码
本文地址: https://pptw.com/jishu/609966.html
