1

I have found this script to map single drive and Relabel the Drive:

' 
Option Explicit
Dim objNetwork, strDrive, objShell, objUNC
Dim strRemotePath, strDriveLetter, strNewName 
' 
strDriveLetter = "H:" 
strRemotePath = "\\FileServer\sharedfolder" 
strNewName = "Save Your Files Here"

' Section which actually (re)names the Mapped Drive
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name = strNewName

WScript.Quit

' End of Example VBScript.

I have multiple shared folder to be shared with some specific users groups. How to modify this script to map multiple drives when user logs onto the domain

other shares

\\FileServer\Share1
\\FileServer\Share2
\\FileServer\Share3
\\FileServer\ShareXX

I know this can be done using net use. but this does not allow Relabeling of shares.

net use x: \\FileServer\Share1
net use y: \\FileServer\Share2
net use z: \\FileServer\Share3
net use J: \\FileServer\Sharexx
  • This would be a lot easier with Group Policy Preferences than a script. – I say Reinstate Monica May 20 '17 at 13:19
  • @Twisty , I tried with group policy but for some reason i could not make it work. that why i posted this script – sadia rehman May 22 '17 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.