2

On Windows 10, I wanted to map drive letters to local folders. I used subst initially, but then I found out that deleted files from the mapped drives would just disappear, rather than going to the Recycle Bin. I followed the instructions from Tony and others here, and got the mapped drives to work with the Recycle Bin, using a .reg file. Which is great. Thanks to everyone who contributed!

But I would also like to change the drive name, aka the drive label, on the mapped drives. Currently Windows just picks up the name of the root drive. For example, my C: drive name is "1TB SSD". I mapped the P: drive to C:\File Server\Photos, and I would like the P: drive label to be "Photos", but instead it shows up as "1TB SSD".

When I right click on the P: drive in windows explorer, and go to "Rename", I get the message "Invalid drive Label The volume label is not valid. Please enter a valid volume label." I don't get this error message when I rename the "real" drives (C: D: etc.), only when I try to rename the drives that were mapped from local folders.

I've googled around and tried several things. The latest was adding "VolumeLabel" to the registry entry. I was hopeful that that might do it, but no luck.

Here's what my mapping looks like in the .reg file:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]  
"P:"="\\??\\C:\\File Server\\Photos"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{GUID}]
"RelativePath"="P:\"
"Category"=dword:00000004
"Name"="PhotosN"
"DefaultLabel"="PhotosD"
"VolumeLabel"="PhotosV"

I would greatly appreciate it if someone has an answer for this! :)

DavidPostill
  • 156,873
  • @DavidPostill Good article, but no luck. Might work on root drives, but on mapped drives the labels didn't budge.

    1 - Disk Management -- only the root drives show up, not the mapped drives

    2 - File Explorer -- "The volume label is not valid. Please enter a valid volume label".

    3 - Command prompt (as administrator):

    P:>label P: Photos
    Access Denied as you do not have sufficient privileges or the disk may be locked by another process.
    You have to invoke this utility running in elevated mode and make sure the disk is unlocked.

    4 - Registry change - no effect

    – Nathaniel Tanner Jul 31 '22 at 20:55

1 Answers1

1

I have a drive like your drive P: set in the registry in the DOS Devices like you do. I loosely followed this Wikipedia article to give this drive a label: https://en.wikipedia.org/wiki/SUBST

For drive C: and drive P:, I put in the registry:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\C\DefaultLabel\
  • and
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\P\DefaultLabel\
  • with their (Default) value equal the label name I want them to be. It seems I had to do C drive too, not just the P drive. I set C drive's to "OS", and P drive's to "POPCORN".

Then using cmd.exe, I cleared the C drive with LABEL C:, and put an empty label in there.

Then I refresh File Explorer (F5), and the new names showed up. Seems to work ok.

Mafu Josh
  • 226
  • 1
    That worked, thanks! I actually didn't need to do anything with SUBST or LABEL. The P drive was already mapped, so I just opened regedit, manually added the DriveIcons\P key, then the DriveIcons\P\DefaultLabel\ key, and set its "(Default)" value to "Photos". That did the trick! – Nathaniel Tanner Sep 23 '23 at 16:33