请教一下如何取得磁盘的VolumeName
如题,小弟虚心求教.[ 本帖最后由 ceoguang 于 2008-7-13 21:20 编辑 ] ; 生成于 AutoIt Scriptomatic
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$Output = $Output & "Computer: " & $strComputer& @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_MountPoint", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$Output = $Output & "Directory: " & $objItem.Directory & @CRLF
$Output = $Output & "Volume: " & $objItem.Volume & @CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
Else
Msgbox(0,"WMI 输出","No WMI Objects Found for class: " & "Win32_MountPoint" )
Endif
不知道是不是你想要的。 谢谢,正是我要的.
因为代码有点看不懂
怎么都没见有反映的运行了没见有反映的:face (13): 检查下WMI服务是否启动 进来学习了
页:
[1]