[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Set user friendly name on mapped drives - VBS

Posted on 2011-05-11
Medium Priority
Last Modified: 2012-05-11

I have a logon script mapping drives to the users.

How do I in VBScript set a user friendly name on the share?

For example user on (\\server\share) (H:) to Home (H:)...

Thanks in advance


Question by:mikeydk
LVL 25

Assisted Solution

by:Luis Pérez
Luis Pérez earned 1000 total points
ID: 35736744
Mmmm... try this: once the drive has been mapped, use this API function:

Private Declare Function SetVolumeLabel Lib "kernel32" Alias _
"SetVolumeLabelA" (ByVal lpRootPathName As String, _
ByVal lpVolumeName As String) As Long

You can use it this way:
Call SetVolumeLabel("H:","Home")

Hope that helps.
LVL 65

Accepted Solution

RobSampson earned 1000 total points
ID: 35744246

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
Loops Section Overview
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month18 days, 17 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question