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

Entering login in a batch file

Status
Not open for further replies.

bobdylan

Technical User
Joined
Mar 7, 2001
Messages
83
Location
GB
Hi

I have a batch file that maps a network drive to a letter. What I need to do now though is tell it to use a particular login name (i.e. administrator) so the share can be accessed. Can someone please let me know how this is done.

The line currently reads:

net use f: \\servername\afolder

Thanks
 
surely the user logging on has to have access to the share or they won't be able to use the mapped drive anyway?

So my answer is make sure users running this logon script have correct lovel of access for the mapping to work.
 
True but if you right click on My Computer and go to Map Network Drive you can put in a Logon As username. This is what I want to replicate.

I think I may have solved it so thanks anyway.
 
The parameters you are looking for are as follows:

net use f: \\servername\afolder /user:domain\user password

or

net use f: \\servername\afolder /user:domain\user *

will prompt for the password if you don't want to display it. -----------------------------------------------------
"It's true, its damn true!"
-----------------------------------------------------
 
Brilliant thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top