mistux Site Admin
Joined: 25 Jun 2004 Posts: 1042 Location: South Bend, Indiana USA
|
Posted: Tue Dec 21, 2010 10:59 am Post subject: Map Network Drive |
|
|
Code: | ' MapNetworkDrive.vbs
' VBScript to map a network drive. And provide a message box
' Author Guy Thomas http://www.computerperformance.co.uk/Logon/Logon_HomeDir.htm
' Version 3.2 - September 2005
' -----------------------------------------------------------------'
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath
strDriveLetter = "F:"
strRemotePath = "\\xxxx\yyy" 'Your UNC path goes here
' 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 " Drive: " & strDriveLetter & " is now mapped."
WScript.Quit
' End of MapNetworkDrive Example Logon Script. |
|
|