Drive letter assignment/mounting in Winders

tcsenter

Lifer
Sep 7, 2001
18,352
259
126
I have several fixed disks, a few external HDDs, and several USB flash drives that I connect pro re nata. I always use 'safe removal' feature or shut down properly if the drives are connected 'internally' (mobo SATA ports). All local connections nothing on a domain or network.

Anyone else experience a problem where you connect/disconnect a lot of drives (whether removable storage or fixed disks) multiple times and Windows stops assigning letters on subsequent connects? i.e. you have to go into Disk Management and assign a drive letter 'manually'?

Also, there is a place in the registry where Windows 'stores' a list of previously plugged disks and volumes (fixed and removable) or prior drive letter assignments. I previously stumbled upon this key when looking for something else but can't remember where to find it. I'm wondering where this key is and whether it can be cleared out or reset? TIA!
 
Last edited:

Bubbaleone

Golden Member
Nov 20, 2011
1,803
4
76
I'm a regular drive swapper as well and the (fairly painless) solution I've used for years for cleaning up old drive letter assignments is a simple little batch file that opens the developer version of Device Manager. Device Manager is simply a GUI registry editor.

In the developer version, when you select View > Show Hidden Devices and then expand any category, every nonpresent (no longer installed) device you've ever used on that PC will show up with a pale gray or "ghosted" icon beside it.

Each ghosted icon represents an item that is still contained in the registry, although not currently in use. Hence, the problem of the registry having multiple drive letter assignments for the same drive hardware IDs.

For the batch file, open notepad and enter these two lines:

set DEVMGR_SHOW_NONPRESENT_DEVICES=1
start devmgmt.msc

Then save to your desktop as "SetDev.bat" (not SetDev.txt).

You can safely delete every ghosted icon found under every expanded device category. Note; some screens make it a bit difficult to clearly differentiate between normal and ghosted icon colors so just take your time until you get familiar with it.

Edit: When you've got a large number of ghosted devices to uninstall, the quickest way is to simply highlight the device, hit delete, and then hit enter. Goes quick...

.
 
Last edited:

tcsenter

Lifer
Sep 7, 2001
18,352
259
126
Thanks I had forgotten about 'hidden devices' in Device Manager. BTW your .bat file command doesn't seem to work for Windows 7 SP1. It just brings up regular Device Manager. Then I have to click "View => show hidden device" manually.
 

Bubbaleone

Golden Member
Nov 20, 2011
1,803
4
76
Yeah, I didn't think to mention that there's no obvious difference between the standard and developer version until you actually select 'show hidden devices'. Regularly cleaning up with the dev version is a completely safe means for keeping the registry tidy, and that'll keep poor old Windows from getting confused and going on strike after it's seen the same drives (or any other device) plugged and unplugged one to many times.

.
 
Last edited:

Joseph Combs

Member
Jul 27, 2018
72
12
41
I had a problem where none of my flash drive would install, had to reinstall Windows 10 from scratch to fix it