Monday, September 27, 2010

Assign the same Drive Letter Every Time to USB Drive

How can you make sure that the same drive letter is assigned every time you plug in your USB drive? How can you exempt drive letters assigned to Network drives?

If you right click a drive in Disk Management and assign it a drive letter you are pretty much assured that you will get that drive letter next time-but you can't really be 100% sure.

You also run into problems when a user plugs in a USB drive and then your Network drive letter does not work.

My problem at hand this time was making sure that my mom's USB drive always got the letter E assigned to the USB drive I gave her. I had written a script that mirrored her picture folder. There is no way my 77 year old mother is going to be able to trouble shoot something weird like that.

The solution came via a utility quite a few others recommend: USBDLM.

Here is what I do with USBDLM:

1. Make sure I always assign the same drive letter to USB drives.
2. Make sure my network mapped letters do not conflict with USB drive letters.
3. You know those multi-media readers that have a slot for each type. Each one of those show up as a drive letter even though you do not have a card inserted. USBDLM can make it so a drive letter is assigned only when you insert one.
4. I assign drive letters based in Device IDs.
5. Make the drive letter be assigned by ini file on USB and not conflict with INI file on Computer.

USBDLM is free for personal use, but there is a price for business. The price I found is quite reasonable. The work it does really can't be beat. Ther are more options that I will cover here including working with Firewire. There is also a pretty extensive help file.

I am going to cover the 5 steps above by basically just showing you my INI file. WSBDLM is controlled by INI files.

Please excuse the semicolons since if you would put this into an actual ini, it would be the comments. You could just pear it down. Also I built it based on the template that is included.

; This is my working USBDLM.INI
; Created 9/18/2010

; More informations in the help file USBDLM_ENG.CHM



;------------------------------ Settings -------------------------------------
[Settings]

;here you can let USBDLM remove driveletters of cardreaders as long
;as there is no media present this is done by setting it to "1"
NoMediaNoLetter=1

;here you can let USBDLM write a logfile, default is _USBDLM.LOG in
;the root of the Windows drive
WriteLogFile=0
LogFile=
LogLevel=3


;---------------------------- BalloonTips -------------------------------------
[BalloonTips]

;this activates balloon tips and sets their show
;duration in milliseconds-it gives a nice
;message down in the service tray when you plug in your USB device
Enabled=1
Timeout=6000



;-------------------------- the drive letters ---------------------------------

;here you can define new default drive letter for USB drives
;The first line says look at the ini on usb first.
;In that ini put the letter you want for
;that drive.
;comment out everything on the usb except the section below
;omitting the first line.
;Also, lines Letter= contain USB drive letters you want to assign in that sequence
;to other USB devices you plug in.
;So here the first line says: look on usb drive for ini and set letter from that
;then after that, start with k,l,m to other usb drives
[DriveLetters]
Letters=%drive%\usbdlm.ini
Letter1=K
Letter2=L
Letter3=M


;here you can define drive letter that shall never be used for new local drives
;configure here your network and subst drives here but no local drives!
[NetworkLetters]
Letter1=V
Letter2=
Letter3=


;many other options are documented in the Help files.
;Here is how you assign letter by device ID number.
;Below, while usb is connected do a cmd,
;then dir e:\*.x and then copy paste vol serial
;below (e: is whatever drive letter has at the time).
;Here we will give Y to one, Z to the other.
;finding the vol serial that way is sure
;that you will give the drive the letter you want

[DriveLetters10]
DeviceID1=USB\VID_0781
VolumeSerial=1012-B5C6
Letter=Y

[DriveLetters20]
VolumeSerial=A805-CFBB
Letter=Z

Delco

1 comment:

Rob said...

Excellent, just what I needed. Thanks the examples in your post, took me less than 5 mins to install and got rid of those annoying unused card reader drives.

I now use this with Microsoft SyncToy 2.1 for backing up my uni work from 2 memory sticks (may seem over cautious but you only want to lose 30 hours work once (well not even once really)).