Wednesday, March 12, 2008

Script to Map Network Drives

Script to Map Network Drives

' From the book, "Windows XP Cookbook"
' ISBN: 0596007256
' ------ SCRIPT CONFIGURATION ------

strDrive = "" ' e.g. N:
strPath = "" ' e.g. \\rtp01\c$\temp
strUser = "" ' e.g. AMER\rallen
strPassword = ""
boolPersistent = True ' True = Persistent ; False = Not Persistent
' ------ END CONFIGURATION ---------
set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDrive, strPath, boolPersistent, _
strUser, strPassword
WScript.Echo "Successfully mapped drive"

No comments: