Manufacturing Information Solutions Forum Index Manufacturing Information Solutions
Your Place for Support and Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Map Network Drive

 
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> VB Script
View previous topic :: View next topic  
Author Message
mistux
Site Admin


Joined: 25 Jun 2004
Posts: 1042
Location: South Bend, Indiana USA

PostPosted: Tue Dec 21, 2010 10:59 am    Post subject: Map Network Drive Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> VB Script All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group