dont forget to change the server name and shared folder name...
- Code: Select all
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath
strDriveLetter = "K:"
strRemotePath = "\\servername\folder name)"
' Purpose of the script to create a network object. (objNetwork)
' Then to apply the MapNetworkDrive method. Result K: drive
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
' Extra code just to add a message box
WScript.Echo " Launch Explorer, check: "& strDriveLetter
WScript.Quit
' End of MapNetworkDrive Example Logon Script.
