How can I permanently assign drive letters to my USB devices in Windows?
You can setup Windows so that it remembers the drive letter you asign to a drive, but you have to connect the device and set it up first. This can be done in the Control Panel > Administrative Tools > Computer Management (or run compmgmt.msc if you're as lazy as me). Under Storage > Disk Management, right-click on the drive you want to configure and select Change Drive Letter and Paths.... There you can change the drive letter that's assigned to the drive.
After this is done, whenever the drive is plugged back in, this letter will be used if it's available. If this is too risky for you, you can mount the drive in an empty folder anywhere on the filesystem instead (via the same interface). This works the same as the drive letter in the sense that Windows will only use it if it's available, but it will never do it unless it's explicitly setup to do so.
Instead of trying to define a standard drive letter for your scripts, define an environment variable that you set on each system to designate the USB drive.
One word: USBDLM.
- automatically solves conflicts between USB drives and network or subst drives of the currently logged on user
- you can define new default letters for any/all USB drives
- you can make your 19-in-1 card reader only allocate drive letters for slots that have media inserted
- you can assign default drive letters based on
- bus type
- usb port number
- drive type (CD, removable, fixed)
- drive size
- device ID
- presence of files/folders
- volume label
- volume serial number
- ...
32-bit and 64-bit versions available. This gets installed on each and every Windows system I install. No registry hackery, no disk management tool required, it just works as a persistent service. I cannot recommend this highly enough.
Create your batch file scripts using %~d0 as the drive letter and colon. %~d0 is replaced by the drive containing the script. So if on one machine the thumb drive is F %~d0 is equivalent to F: On another machine the thumb drive is W %~d0 is equivalent to W:
All my scripts are this way because I use my thumb drive in 100s of machines
You can use also Disk Management (part of Computer Management) to give the volume a specific drive letter.