I am looking for a command to rename a few drives that I map every start-up in WinXP. I've got the mapping part down, I'm now interested in naming them programmatically with custom names, so I can keep them straight.
I gave up on DOS and learned PowerShell instead. The end result worked like this:
$Net = New-Object -ComObject WScript.Network
$Rename = New-Object -ComObject Shell.Application
#### # Map the local drives
Subst Q: 'C:\File Path\Uno'
Subst U: 'C:\File Path\Dos'
#### # Map the network drives
$Net.MapNetworkDrive("X:", '\\Server\File Path\Uno')
$Net.MapNetworkDrive("Y:", '\\Different Server\File Path\Dos')
#### # Rename everything
$rename.NameSpace("Q:\").Self.Name = 'Network -> FOO'
$rename.NameSpace("U:\").Self.Name = 'Network -> BAR'
$rename.NameSpace("X:\").Self.Name = 'Local -> FOO'
$rename.NameSpace("Y:\").Self.Name = 'Local -> BAR'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With