Set user friendly name on mapped drives - VBS

Hey

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

Mike

LVL 1
mikeydkAsked:
Who is Participating?
 
RobSampsonConnect With a Mentor Commented:
0
 
Luis PérezConnect With a Mentor Software Architect in .NetCommented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.