Robert_STL Posted September 10, 2017 Share Posted September 10, 2017 Hi guys. I need help with the DriveGetDrive("REMOVABLE") function. Can anybody help to get all USB storage devices listed to a dropdown menue for picking it up one device and open a specified .txt file??? i am confused.. Sorry for my bad english. Link to comment Share on other sites More sharing options...
MagnumXL Posted September 10, 2017 Share Posted September 10, 2017 Here is some script that will retrieve the list of USB storage devices. Just GUICtrlSetData to set the list to your dropdown. #include <AutoItConstants.au3> #include <Array.au3> Local $usbList = "" $aRemDrives = DriveGetDrive("ALL") If IsArray($aRemDrives) Then For $i = 1 To $aRemDrives[0] $driveType = DriveGetType($aRemDrives[$i], 3) If StringInStr($driveType, "USB") Then $usbList &= $aRemDrives[$i] & "|" Next EndIf If $usbList <> "" Then While StringRight($usbList, 1) = "|" $usbList = StringTrimRight($usbList, 1) WEnd MsgBox(0, "USB List" , $usbList) Else MsgBox(0, "Warning", "No USB Drives found.") EndIf Note that using DriveGetDrive("ALL") is important as not all USB devices show up as removable. Link to comment Share on other sites More sharing options...
Robert_STL Posted September 10, 2017 Author Share Posted September 10, 2017 Thanks for your fast reply. i will try it tomorow. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now