Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to map network drive???

Status
Not open for further replies.

EngJoo

Programmer
May 14, 2002
90
MY
Hi everyone,

In BAT file it is

net use n: \\isa\Timberline

Please Advise
 
Try this:

Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")

DriveLetter = "M:"
RemotePath = "\\MyServer\MyShare"


WShNetwork.MapNetworkDrive DriveLetter, RemotePath

set WshNetwork = nothing
set WshShell = nothing


Obviously you will have to change the drive letter and server and share names to suit you self.

HTH Jamie Gillespie
j-gillespie@s-cheshire.ac.uk
 
or if you prefer to continue using the NET USE command:

Set oShell = WScript.CreateObject("WScript.Shell")
oShell.Run "command.com /K net use n: \\isa\Timberline" Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top