Is it possible to set hard drive lettering permanently

pewe

Member
Member
Messages
113
I have a 'robocopy' script to copy files from an internal hard drive to a destination "R:\Documents backup", drive letter 'R' having been allocated to the drive when I formatted it.

I also set up a Task in 'Task Scheduler' to run this script each time a USB drive is attached to the computer - which works,
If the drive connected is not 'drive F' the script starts and stops immediately. If it is drive F then the script runs.

My question is - having set the drive letter for a given drive in Disk Management under Administrative Tools is that enough to set the letter for that hard drive permanently - so that other drives will not be allocated that drive letter at any time and have the files copied to them too - or do I need to do something else?

Thanks for any guidance.
 

My Computer

System One

  • OS
    Win 8 Pro - 64Bit
    System Manufacturer/Model
    Acer 8930
    Memory
    6GB
    Hard Drives
    WD 300GB, WD 500GB
Drive Lettering in Disk Management can be permanent but I think from what I've read it on various forums it may depend greatly upon plugging the drive into the same USB port although the 3 I have connected to Win7 have stayed the same letters after unplugging and plugging back in, sometimes don't pay attention with the unmarked cables to a particular port. But then I don't move the drives to different computers. Disk Management hasn't put 2 drives on the same letter for me, don't think it can and certainly not a choice when assigning drive letters, have to pick a different one. If wanting to put a drive on a certain letter that letter has to be free, sometimes have to move a drive to a different letter first. If using a NAS/Network Attached Storage drive Windows tends to assign letters beginning with Z:, I have a NAS on Y: and Z:, Y: is the latest addition. Accessing the NAS drives on another computer can change the lettering on that computer depending upon which one is linked to first, i.e. Z: could become Y: but only on that computer.
 

My Computer

System One

  • OS
    WinXP, WinVista, Win7, Win8.1, Win10, Linux Mint 20
    Computer type
    PC/Desktop
    System Manufacturer/Model
    2 Customs and 12 OEM/Brands
    CPU
    AMD and Intel
Thanks Berton

I have never had occasion to allocate drive lettering to stick with a disc before, so have never really taken notice of how 'permanent' the labeling was.

I take your point about different USB ports - something that hadn't even crossed my mind.

I guess I'll just have to 'suck it and see' as they say - and keep an eye on the situation.

I did read somewhere that the Task Scheduler could be set to only run if a drive with a certain 'disc id' was inserted.
But I don't know how that's done, or even how to identify the 'id' that task scheduler looks at.

UPDATE EDIT.

Just found a reference which looks similar to the 'disc id' issue - although uses 'event id'.
It;s here for anyone interested
 

My Computer

System One

  • OS
    Win 8 Pro - 64Bit
    System Manufacturer/Model
    Acer 8930
    Memory
    6GB
    Hard Drives
    WD 300GB, WD 500GB
Re: USB drive letters. As best i understand it

  • The USB mass storage (UMS) driver is installed when you first connect a UMS device to a port (you get that USB driver install message)
  • A new "instance" of the driver is installed each time you connect that USB device to a different port. (I use the word "instance" as only one copy of the driver files are installed on disk. Each "instance" is a different registry entry that associates the USB device, the port and the names of the driver files on disk.) Note for each "instance" you get another USB driver install message
  • USB drive letter assignment is stored in the driver data in the registry
  • Drivers (and driver data in the registry) aren't removed when you simply unplug a device but only when you uninstall the device (Note there's no driver install message when you replug a device that already has a driver "instance" for that device on the that port)
  • That's one common cause of USB drive letter conflicts (same drive letter assigned to different USB devices - unplug one device then plug in a new one can cause Windows to assign same drive letter)

All that said, I've never used it, but you might look at the USB Drive Letter Management tool. Among other features, you can control drive letter assignment to a UMS device using the tool and modifying the .INI file on a USB mass storage device
 

My Computer

System One

  • OS
    windows 8.1
Hmmm.......
Just as I feared - something has gone belly up.

When I insert the drive it no longer triggers the task in Task Scheduler (although the script runs if I manually start it).

So not very reliable. :(
 

My Computer

System One

  • OS
    Win 8 Pro - 64Bit
    System Manufacturer/Model
    Acer 8930
    Memory
    6GB
    Hard Drives
    WD 300GB, WD 500GB
Here's what I have setup in Task Scheduler

General.png

trigger.png

actions.png

I'm not sure if the trigger event ID is right - I got that off the very page that you sent the link for.
Although I had seen it, I did not use his script, I used robocopy in Task Scheduler instead.
 

My Computer

System One

  • OS
    Win 8 Pro - 64Bit
    System Manufacturer/Model
    Acer 8930
    Memory
    6GB
    Hard Drives
    WD 300GB, WD 500GB
Son-of-a-gun. Like I said, i never tried this before so can't provide experienced knowledge. But I just did a quick test using 2 different USB flash drives plugging them into different ports: some on the machine and some on a USB hub

Ad hoc test showed one drive always generating the event 1003 when plugged in. But the other NEVER generated an event when plugged in!? :confused: Off hand the biggest difference between the two: one is USB 3.0 (event created) other is USB 2.0 (no event). That's just a quick test and ad hoc conclusion.

So I think you need start by checking for the event when you plug in a drive.

  • Open Event Viewer (CtlPnl->Admin Tools->Event Viewer)
  • Expand Application and Services->Microsoft->Windows->DriverFramworks-UserMode->Operational. Then you'll see all the events
  • For testing purposes, filter the log just to see if/when the 1003 event occurs. On right side of Even Viewer window, Cclick on Filter Current Log. Then per snapshot below set Logged= Last Hour, use the pull down menu set Event Sources as shown, and as shown, enter 1003. Click OK

Now plug in your USB drives. See if/when the event is generated for your case and if the result also seems drive dependant.

/* EDIT */
One thing you can do (that i didn't try) also clear the event 1003 from the filter so you see all the DriverFramework events. Mabe something else gets generated you can use besides the 1003 if a driver doesn't generate a 1003??
 

Attachments

  • View1.jpg
    View1.jpg
    342.2 KB · Views: 46
  • View2.jpg
    View2.jpg
    69.2 KB · Views: 64
Last edited:

My Computer

System One

  • OS
    windows 8.1
I have done a bit more testing and find that this method is somewhat inconsistent.

As far as the event 1003 is concerned I have found that this only seems to appear once when I insert the first of 2 different drives and does not appear when I insert the second.

log3.png

I also sourced other events that occur when I insert drives and tried using those in the trigger.

They worked at first, then after a while they too stopped initiating a backup.

So a bit more investigation and research for a better solution I feel. :(
 

My Computer

System One

  • OS
    Win 8 Pro - 64Bit
    System Manufacturer/Model
    Acer 8930
    Memory
    6GB
    Hard Drives
    WD 300GB, WD 500GB
Awhile back I also tried to assign USB sticks their each driver letter. I named each stick a unique name, then used Acronis Disk Manager and/or MS Drive Manager to assign a letter to each uniquely-named stick. I think it only worked when each stick was inserted into the same usb port again and again. However, because Acronis True Image couldn't care less what Windows shuffleboarded drive letters, I gave up on same.
Since you're running a script, you probably have to somehow automate the drive-letter assginment to the particular usb device. Please let me know if you succeed, I would like to try what you are trying again!
 

My Computer

System One

  • OS
    Windows 7 Pro 64bit [MS blue-disk set]
    Computer type
    PC/Desktop
    System Manufacturer/Model
    2 Acers & 1 Antec[?]
    CPU
    i7 in 2 Acers, i5 in desktop
    Motherboard
    Desktop w/Gigabyte
    Memory
    Two w/16GB, 1 w/8GB
    Graphics Card(s)
    Laptops GameWorthy; Desktop maybe GameWorthy
    Monitor(s) Displays
    flatscreens; 2 are BluRay worthy
    Screen Resolution
    1368x768; 1600x900
    Hard Drives
    1TB internals; 2 ext usb WD 1TB HDs
    PSU
    what's PSU?
    Cooling
    Regular plus external fans
    Keyboard
    desktio w/PS2
    Mouse
    desktop w/PS2
    Internet Speed
    DSL middle level [160?]
    Browser
    from Netscape 0.9 to FF 36
    Antivirus
    well-balanced, well-configured mult-layered defense is best
    Other Info
    From MS-DOS 3.3, MS-DOS 6.22, from Windows 3.1 to WFW 3.11 to Windows 95-98SE, now to Windows 7 Pro.
    Security for now: Windows 7 Firewall, Emsisoft AM, MSE [scan-only], SpywareBlaster, Ruiware/BillP combine
Roland - I have cracked my problem.

What is it you are trying to do - just re-assign drive letters, or do an automated backup when you insert a USB device?

If it is just to assign drive letters, I have found that doing this in 'Disk Management' works - or appears to.
I assigned an external drive with a drive letter and then tried it in all 4 USB ports - the same drive letter was allocated each time.

If you want to backup files from the PC to a USB (or the other way round), I now have a script that will do that when a particular USB device is inserted. The script runs as a process and watches the usb port for device insertion and launches a backup (synchronisation) script when it sees the scripted device inserted. It can identify the device by drive number and name, or name only (although I haven't yet tried the latter).
It should also be possible to monitor for more than one device and run different scripts dependent on the device inserted - although I haven't tried that yet either.

If that's what you need, I will be documenting the details shortly and will let you have a copy,
 

My Computer

System One

  • OS
    Win 8 Pro - 64Bit
    System Manufacturer/Model
    Acer 8930
    Memory
    6GB
    Hard Drives
    WD 300GB, WD 500GB
Great job! :thumbsup:

I'm not a powershell user (yet) but you've clearly shown powershell really is powerful! Trying to monitor the event log for USB events is "old technology". Well done!
 

My Computer

System One

  • OS
    windows 8.1
Thanks ComputerGeek

But credit must go to the poster of the message you linked to earlier even though it was posted 5 1/2 years ago.

I had seen it before, but only yesterday/today had the time to figure out what he was doing then worked through it altering/adding to it to suit my needs.

It certainly seems to work well.

Also the DirSync program is great - it works well and does not mind multiple instances working at the same time on different scripts.
 

My Computer

System One

  • OS
    Win 8 Pro - 64Bit
    System Manufacturer/Model
    Acer 8930
    Memory
    6GB
    Hard Drives
    WD 300GB, WD 500GB
Well, then.... +1 for your humble reply! :)

I only skimmed the first half of the thread I posted. So, I only noticed discussion of using Windows event log. I just took a second look now that you mention to see its discussion of power shell later in the thread, as well. Still, good job putting it all to use :)
 

My Computer

System One

  • OS
    windows 8.1
pewe, I downloaded your pdf into my ReadingMaterial folder; thanks!
 

My Computer

System One

  • OS
    Windows 7 Pro 64bit [MS blue-disk set]
    Computer type
    PC/Desktop
    System Manufacturer/Model
    2 Acers & 1 Antec[?]
    CPU
    i7 in 2 Acers, i5 in desktop
    Motherboard
    Desktop w/Gigabyte
    Memory
    Two w/16GB, 1 w/8GB
    Graphics Card(s)
    Laptops GameWorthy; Desktop maybe GameWorthy
    Monitor(s) Displays
    flatscreens; 2 are BluRay worthy
    Screen Resolution
    1368x768; 1600x900
    Hard Drives
    1TB internals; 2 ext usb WD 1TB HDs
    PSU
    what's PSU?
    Cooling
    Regular plus external fans
    Keyboard
    desktio w/PS2
    Mouse
    desktop w/PS2
    Internet Speed
    DSL middle level [160?]
    Browser
    from Netscape 0.9 to FF 36
    Antivirus
    well-balanced, well-configured mult-layered defense is best
    Other Info
    From MS-DOS 3.3, MS-DOS 6.22, from Windows 3.1 to WFW 3.11 to Windows 95-98SE, now to Windows 7 Pro.
    Security for now: Windows 7 Firewall, Emsisoft AM, MSE [scan-only], SpywareBlaster, Ruiware/BillP combine
No problem Roland.

It looks rather daunting, but it is very quick and easy to do - and it seems to work more reliably than using the other methods I tried.

Hope you find it useful.
 

My Computer

System One

  • OS
    Win 8 Pro - 64Bit
    System Manufacturer/Model
    Acer 8930
    Memory
    6GB
    Hard Drives
    WD 300GB, WD 500GB
Back
Top