There is no way to do this using only the
net use command (see documentation), but there is a way to do this using a vb script, as described by Guy Thomas at computerperformance.co.uk here
In case his Guy's site disappears later, here is his a copy of his script:
' VBScript to map a network drive.
' Authors Guy Thomas and Barry Maybury
' Version 1.4 - April 2010
Dim objNetwork, strDrive, objShell, objUNC
Dim strRemotePath, strDriveLetter, strNewName
strDriveLetter = "W:"
strRemotePath = "\\192.168.1.2\example\sharename"
strNewName = "Example Readable Label"
' Section to map the network drive
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
' Section which actually (re)names the Mapped Drive
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name = strNewName
Wscript.Echo "Check : "& strDriveLetter & " for " & strNewName
' End of Example VBScript.
W: doesn't work for you, try
W:\ (with the slash)
- This method will set the drive letter label permanently, i.e. if you later connect another share to the same drive letter, that new share will also get the old label. This can be fixed by either always using this script when connecting shares, or by deleting a key in the registry to revert to normal behaviour.
Reverting to normal behaviour:
- Launch regedit and then click on
Edit (menu) ->
Example Readable Label
- Or navigate in regedit to
- Just delete the value - leave it blank. The result will be that future drive mapping will revert to the traditional style of mapping.
All of this is more thouroguhly described at Guy's website.