Windows Logon Script - Rename MapNetworkDrive
Introduction to Map Network Drive - Rename Mapped Drive
After you create a new mapped network drive, if you look in Windows Explorer, then what you see under Network Drives is: 'sharename on server (W:)'. I have discovered how to rename this display string by writing a VBScript. A word of warning, the side-effect of my script is that all mapped drives get the name specified by strNewName. However, I will show you a Regedit technique to correct this undesirable effect.
Topics for Rename Network Drive
Here is the story behind this script. For ages, readers have been asking me how to control the name of a mapped network drive. At the back of my mind, I knew it must be possible to rename this drive letter namespace. My thinking was that if you can manually, right-click and rename the mapped drive, then it should be possible to do the same job with a VBScript.
Then one day, Barry kindly sent me a VBScript, which renamed the local drive letter. I simply love readers who send me script ideas. I thank you again Barry.
When you map a network drive, the operating system automatically calculates an appropriate name for the label that you see in Explorer. The formula that XP uses is: sharename & computer description name & (Letter). For example: Home on Green Server (z:).
Note Jesper Hoffmann Larsen found that you must have the backslash in the drive-string, e.g. z:\ worked for him, not my plain z: naming.
Note 1: Observe how we create a shell object in addition to the usual network object.
Note 2: The key command is: objShell.NameSpace(strDriveLetter).Self.Name. Let us breakdown this statement into three parts:
a) NameSpace(), means: 'go and get the name of what ever is inside the brackets', in our
Note 3: I say again, if this does not work for you, try adding a backslash to the strDriveLetter = "W:\" rather than "W:"
SolarWinds' Config Generator is a free tool, which puts you in charge of controlling changes to network routers and other SNMP devices. Boost your network performance by activating network device features you've already paid for.
Guy says that for newbies the biggest benefit of this free tool is that it will provide the impetus for you to learn more about configuring the SNMP service with its 'Traps' and 'Communities'. Try Config Generator now - it's free!
The problem is that once give the mapped network drive your name, strNewName, then it always gives that particular drive letter strNewName. Let me illustrate by way of an example.
V: is mapped to \\ alan\reports. You set strNewName = " Boss Reports".
Let us assume that later, you map the V: drive to \\ betty\tax. Unfortunately, the V: drive will still be called strNewName. The network share will appear to be "Boss Reports" (V:), not 'Tax on Betty (V:)'.
Good news; there are two solutions. It has probably occurred to
you that all you have to do is re-run the script, but change:
Alternatively, you could edit the registry. What I did was launch regedit and then click on Edit
(menu), Find, "Boss Reports". Much to my surprise, the value turned up under MountPoints. The full path was
Does the name that the operating assigns a mapped network drive annoy you? If so, then here is just the script to rename that long description, With a VBScript, you can persuade Explorer to display name that you chose for mapped Network Drive text.
See more printer logon scripts examples