本帖最后由 itsky2 于 2020-4-13 09:13 编辑
下面是我自己尝试的,无效...
Local $tTag = DllStructCreate("char buffer[256]")
$aRet = DllCall("Kernel32.dll", "int", "FindFirstVolumeMountPoint", "str", $sGUID, "str", $tTag, 'int', DllStructGetSize($tTag))
sGUID这个是设备标识符,用下面的代码可以取到:
$RET = DllCall("Kernel32.dll", "int", "FindFirstVolume", "str", "", "str", 255)
ConsoleWrite($RET[1] & @TAB & DriveGetLabel($RET[1]) & @TAB & DirGetSize($RET[1]) & @CRLF)
$RET[1] = $RET[0]
While 1
$RET = DllCall("Kernel32.dll", "int", "FindNextVolume", "int", $RET[1], "str", "", "str", 255)
If Not $RET[0] Then ExitLoop
ConsoleWrite($RET[2] & @TAB & DriveGetLabel($RET[2]) & @CRLF)
WEnd
|