I am trying to use DriveGetType to find all the removeable storage devices attach to any given computer. I am using the following code:
Func GetDrives()
; Fill the destination list
Local $drives = DriveGetDrive("ALL")
If @error == 1 Then
MsgBox(0, "Error", "No removeable media found, cannot continue!" & @CRLF & "Please insert a micro SD card or other removeable media to copy to.", 15)
;GUISetState(@SW_SHOW, $mainwindow)
GUISetState(@SW_HIDE, $cabswindow)
Else
For $i = 1 To $drives[0]
Local $drive = $i
Local $type = DriveGetType($i & "\")
If @error == 1 Then
$type = "Error getting drive type"
EndIf
ConsoleWrite($drives[$i] & "\ " & $type & @CRLF)
Next
EndIf
EndFunc ;==>GetDrives
When I run that bit of code, I see the following in the console window:
c:\ Error getting drive type
e:\ Error getting drive type
g:\ Error getting drive type
h:\ Error getting drive type
q:\ Error getting drive type
t:\ Error getting drive type
Is DriveGetType not able to get the device type from a root directory (IE: C:\) only, or does it require a full path to find the root device?
I would think the above would work just fine, but alas, it does not seem to. Any help is greatly appreciated.
- Vadtec