Link to home
Start Free TrialLog in
Avatar of sasllc
sasllcFlag for United States of America

asked on

How to assign the same drive letter to an external drive each time?

I have several customers on Win10 Pro that have two identical external hard drives.  When I plug them in the first time and format them, I also go into Disk Management and change the drive letter to K:  But as time goes on and they swap the drives each week, one or both no longer get set to K:, which makes the backup routine fail.

Is there a way to automate this process to insure they always get assigned as drive K?  (These is never a conflict--but the OS often assigns them to drive E: which is the next available.)  

If it cannot be automated, then I could consider some type of batch file to tell the user to run each week when they change out the drive.  I would need detailed guidance.  But what I cannot do with these non-high-tech customers is expect them to run Disk Management properly.  TIA
ASKER CERTIFIED SOLUTION
Avatar of Hello There
Hello There

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bill Prew
Bill Prew

If you were to set a volume label on the external drive to something that would never change then you could use a small BAT file that they user manually ran after connecting the drive that would assign the drive to K.  Would that work, if so I could work up a starting BAT file for you.

My thinking is the BAT file would look at all drives and find the one with the volume label that matches what you set it to.  It would then check the assigned drive letter and if not K would assign it to K.


»bp
Avatar of sasllc

ASKER

Using this approach:

diskpart
list volume
select volume <number>
assign letter=K

The <number> might change from time to time--true?  If so, my customers would not be able to handle something like this correctly.

I don't understand about the "relative paths", so I would need an example.  But note that I could use a UNC path rather than a drive letter if that would help, such as \\AcronisBackups\WS1\ to get to where I want to create the backup file.

If a batch file is best, having a sample would be greatly appreciated.  Note that when I first set up the two external drives for the customer I format them and give them both a volume name of "AcronisBackups".
It doesn't look easy to create a BAT file that re-assigns to K: if it is a different letter.  It used to be that diskpart wasn't too hard to script, you could pipe commands into it, but that doesn't seem to work any more.  There is also a /S option to process a text file of commands, but that isn't working for me either.  Not sure if UAC is interfering, since it's asking to elevate privs.

At any rate it's looking more complex than I thought, which typically means it won't be as reliable when implemented.  I suspect there is something easier that could be worked up in Powershell, but I'm not a master there yet...


»bp
A few years ago I needed the same... Just reserve the specific letter for my USB drive. So I assigned the letter in Disk Management and I've never had an issue with this since then. If I connect the drive, it's been getting the same letter for years now.

Since this is not working for you, I suggest to use the third party solution - USB Drive Letter Manager (link here).
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial