Solved subst - Mapping Filepath as Drive - "Local Disk (C:)" vs "Windows (C:)" - Relabeling Error


micahs

New member
Local time
5:47 AM
Posts
6
OS
Windows 11
We are attempting to map a filepath (linked OneDrive folder location) as a local drive via a shortcut in the windows startup folder.

The method described in that link works, and any computer that displays the C: drive as "Local Disk (C:)" will allow the user to rename (relabel) the drive. (e.g.: "Local Disk (R:)" => "Documents (R:)").

However, while this method does successfully map as a drive, computers that show the drive as "Windows (C:)" will not allow users to rename (relabel) the drive. Instead, they receive the error: "The volume label is not valid. Please enter a valid volume label."

How would we go about renaming these mapped drives?
Furthermore, what is the distinction between the "local disk" and "windows" prefix?

Any help or insight would be greatly appreciated.


thanks,
 
Windows Build/Version
Windows 11

My Computer

System One

  • OS
    Windows 11
We are attempting to map a filepath (linked OneDrive folder location) as a local drive via a shortcut in the windows startup folder.

The method described in that link works, and any computer that displays the C: drive as "Local Disk (C:)" will allow the user to rename (relabel) the drive. (e.g.: "Local Disk (R:)" => "Documents (R:)").

However, while this method does successfully map as a drive, computers that show the drive as "Windows (C:)" will not allow users to rename (relabel) the drive. Instead, they receive the error: "The volume label is not valid. Please enter a valid volume label."

How would we go about renaming these mapped drives?
Furthermore, what is the distinction between the "local disk" and "windows" prefix?

Any help or insight would be greatly appreciated.


thanks,
Hi and welcome,

The subst command is not an actual mapping, it is no more than a shortcut to which a drive letter has been assigned, it has some perks but should not be considered a real drive.
Allowing the user to change the label would render its source problematic to decipher, so users are prevented to do so.

Windows is where the OS resides. -That label can be changed to OS or anything you wish, but not its substituted secondary label.
Local disk can be another partition not containing the OS.
 

My Computers

System One System Two

  • OS
    Win11 All /Debian/Arch
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDCSDAPNUW-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & ADSL Bouygues -fr
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
    Other Info
    VMs of Windows 11 stable/Beta/Dev/Canary
    VM of XeroLinux- Arch based & Debian 12
  • Operating System
    Windows 11 Insider Canary
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM
Hi and welcome,

The subst command is not an actual mapping, it is no more than a shortcut to which a drive letter has been assigned, it has some perks but should not be considered a real drive.
Allowing the user to change the label would render its source problematic to decipher, so users are prevented to do so.

Windows is where the OS reside.
Local disk can be another partition not containing the OS.
Thank you for the response!

Using the link above, we were able to "map" - or otherwise use the drives as local drives - AND rename the drives successfully - but only on computers where the drive is prefixed with "Local Disk" and not "Windows".

We are trying to achieve the same results with the same method, but are greeted with the error "The volume label is not valid. Please enter a valid volume label." on computers that call local disks, such as the C: drive, "Windows (C:)" instead of "Local Disk (C:)". (or any other drive letter).

I cannot find documentation on why there is even a distinction between "Windows" and "Local Disk" - much less an explanation on why the successful workflow to "map" these drives is unsuccessful on the former.
 

My Computer

System One

  • OS
    Windows 11
Thank you for the response!

Using the link above, we were able to "map" - or otherwise use the drives as local drives - AND rename the drives successfully - but only on computers where the drive is prefixed with "Local Disk" and not "Windows".

We are trying to achieve the same results with the same method, but are greeted with the error "The volume label is not valid. Please enter a valid volume label." on computers that call local disks, such as the C: drive, "Windows (C:)" instead of "Local Disk (C:)". (or any other drive letter).

I cannot find documentation on why there is even a distinction between "Windows" and "Local Disk" - much less an explanation on why the successful workflow to "map" these drives is unsuccessful on the former.
You can get a clearer answer by going to a command prompt and typing:
label <Subst. Drive> <new Label Name> and read the error. The OS simply does not allow it.

But I must ask: Why not use a share or a network resource using net use since you are obviously on some kind of network?
 

My Computers

System One System Two

  • OS
    Win11 All /Debian/Arch
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDCSDAPNUW-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & ADSL Bouygues -fr
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
    Other Info
    VMs of Windows 11 stable/Beta/Dev/Canary
    VM of XeroLinux- Arch based & Debian 12
  • Operating System
    Windows 11 Insider Canary
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM
You can get a clearer answer by going to a command prompt and typing:
label <Subst. Drive> <new Label Name> and read the error. The OS simply does not allow it.
I attempted the CMD prompt as admin, and it reports "parameters not compatible". However, on that same machine (which views local disks as "Local Disk" not "Windows"), I was successful in right-clicking the drive and "renaming".

To be clear - the O.S does allow us to add the map drive and rename it. We followed the steps linked in the OP, created a "mapped" drive, and renamed the drive. (e.g. Documents (R:)).

We did this on multiple computers, but were not successful on machines that - by default - label local disks as "Windows" instead of "Local Disk" (e.g. Windows (R:)).

So, the question remains - why am I able to change the name on "local disk", but not "windows" drives - and what is the distinction between the two?
(and now, why can I change it manually but not in CMD?)

But I must ask: Why not use a share or a network resource using net use since you are obviously on some kind of network?

Our company uses sharepoint, which does not allow network mapping. We need a much shorter file path with consistent drive letters to retain integrated linked documents.

Sharepoint has made the "on premises" version of their servers obsolete, so we are having the users map the OneDrive account as a local drive.
 

My Computer

System One

  • OS
    Windows 11
The difference between the disks labelled Windows and the ones labelled "Local Disk" is that the former have a drive label set and the latter do not. If you right-click the Windows drives and go to Properties, you will see the label is set to Windows. On the other (Local Disk) disks, there is likely nothing specified.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 [rev. 3447]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical Keyboard with Cherry MX Clears
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical Keyboard - Cherry MX Clear
The difference between the disks labelled Windows and the ones labelled "Local Disk" is that the former have a drive label set and the latter do not. If you right-click the Windows drives and go to Properties, you will see the label is set to Windows. On the other (Local Disk) disks, there is likely nothing specified.

This is on the right track! For some reason, it looks like the other computers "label" these volumnes "windows" by default?

Below are snips from the successful renaming of the drive (attempted John, but wasn't able in command prompt - but as you can see, the drive is "renamed" to John - though this name does not appear in the properties).

Comparing with the unsuccessful computer- there is a name "Windows" in the property, and we can't change it.

Success.png

Fail.png

Error.png


WHY
 

My Computer

System One

  • OS
    Windows 11
Try navigating in the registry to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2. You should have a subkey there for the drive letter that you used in subst. In that key, create a REG_SZ value called _LabelFromReg, and set it to what you want the subst drive letter's label to be.
 

Attachments

  • changing subst drive label.png
    changing subst drive label.png
    11.4 KB · Views: 1
  • changing subst drive label 2.png
    changing subst drive label 2.png
    4 KB · Views: 1

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 [rev. 3447]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical Keyboard with Cherry MX Clears
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical Keyboard - Cherry MX Clear
Unfortunately, this portion of the registry is empty on both machines:

No Option.png
 

My Computer

System One

  • OS
    Windows 11
Well just make a key then. If your drive letter is R, make the key ...CurrentVersion\Explorer\MountPoints2\R. Just like my regedit screenshot, except I was using drive X.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 [rev. 3447]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical Keyboard with Cherry MX Clears
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical Keyboard - Cherry MX Clear
Also this batch file works, to map drive O: to the root of the user's OneDrive, and set the O: drive label to "OneDrive." (Clever label, I know.)

Batch:
@echo off
subst O: "%ONEDRIVE%"
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\O" /v "_LabelFromReg" /t REG_SZ /d "OneDrive"
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 [rev. 3447]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical Keyboard with Cherry MX Clears
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical Keyboard - Cherry MX Clear
It works!! Both the manual registry update and the batch file - thank you so much!

I would love to understand why the circuitous route for these select computers - the only difference between the machines is Windows Pro vs Windows Home - could that have something to do with this?
 

My Computer

System One

  • OS
    Windows 11
I just installed Windows 11 Home and Pro in VMs, and neither one sets the OS drive label to anything. You mentioned this is a corporate environment; maybe something in your IT's imaging process sets the drive label for one OS but not the other?
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 [rev. 3447]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical Keyboard with Cherry MX Clears
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical Keyboard - Cherry MX Clear
I just installed Windows 11 Home and Pro in VMs, and neither one sets the OS drive label to anything. You mentioned this is a corporate environment; maybe something in your IT's imaging process sets the drive label for one OS but not the other?
True. WinPE Setup won't create any volume labels for you.

But many IT folks like to follow the Deployment lab scripts provided in Windows Setup docs. Their example add volume labels for illustration, but the OS really doesn't care or need them.
Code:
select disk 0
clean
convert gpt
create partition efi size=100
format quick fs=fat32 label="System"
assign letter="S"
create partition msr size=16
create partition primary
shrink minimum=500
format quick fs=ntfs label="Windows"
assign letter="W"
create partition primary
format quick fs=ntfs label="Recovery"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
 

My Computer

System One

  • OS
    Windows 7

Latest Support Threads

Back
Top Bottom