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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mapping drive

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
is there anyway I can map to a network drive, where i can input the username and password? thanks
 
If you are speaking of doing it in VB Script, or in VBA, then this will not help. If you are just wanting to map a drive manually, then just right-click on the "My Computer" icon (may have a Server or PC name on it if in a corporate environment), and select "Map Network Drive", then go throug the prompts. That will set up the drive to appear in a similar manner as your local drive(s).

If you were looking for a scripting or programming type answer, then please accept my appology for assuming otherwise.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
If you want a programatic answer, look at the WshNetwork object and its MapNetworkDrive mehtod.
 
where is this wshnetwork object and mapnetwork method found
i am running excel 2000
 
Code:
Set oWSHN = CreateObject("WScript.Network")
oWSHN.MapNetworkDrive("Z:", "\\UNC\Path\Here", bPersist, _
  strUser, strPassword)

bPersist - Optional Determines if the mapping will be
included in the users profile
strUser - Optional User name
strPassword - Optional Password.
 
do you know if this can be used to create a batch file.
i tried
net use f: \\server\share

but it didnt prompt me for user name only a password, but my usual password did not work when i entered it. can i include the username and password in the file without inputting it manually thanks
 
NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]

For more information, type "net help use" at a command prompt.




[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top