I'm trying to create a batch file for backing up folders to a usb drive. In a certain point I want the batch to show a list of all avalaible USB Drives connected to the computer and then asking the user to select the drive letter of one of them to proceed.
As for the the list: I want to combine those two outputs in one line per usb drive
wmic logicaldisk where DriveType^=2 get deviceid
wmic diskdrive where mediatype^="removable media" get Caption, SerialNumber
As for the choice command: How can i use the drive letters as choices for the user to select from?
LogicalDisk
with"DriveType='2'"
or the aliasDiskDrive
with"MediaType='Removable Media'"
selects USB drives. Not only are all USB drives not registered as Removable, all Removable drives are not USB. I'd advise that you use"InterfaceType='USB'"
withDiskDrive
in order to begin trying to determine the respective drive letter for each of its results. – Compo