Chỉnh sửa nội dung ở những phần in đâm
’ NameDrive.vbs
‘ VBScript to map a network drive.
‘ —————————————-’
‘
Option Explicit
Dim objNetwork, strDrive, objShell, objUNC
Dim strRemotePath, strDriveLetter, strNewName
‘
strDriveLetter = “W:”
strRemotePath = “\abc.com”
strNewName = “Reports”
‘ 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
WScript.Quit
‘ End of Example VBScript.