Link to home
Start Free TrialLog in
Avatar of RISLA
RISLAFlag for United States of America

asked on

Map drive via bat file

Hoping to get some assistance using a bat file to map (or re-connect) a network drive.

I need the bat file to include a username and password.

The current bat file doesn't work:

net use H: \\SERVER\D$ PASSWORD /user:adminstrator
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

If you are already connected as a different user to the same user then you can't.... you could create a new share to d:\ whch had share permissions for your user though?

What error do you get?

Steve
Avatar of RISLA

ASKER

Problem is that it keep becoming disconnected. This bat file is used to reconnect the drive.
add /persistent:yes to the end
ASKER CERTIFIED SOLUTION
Avatar of Darius Ghassem
Darius Ghassem
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RISLA

ASKER

THANKS!
Avatar of Bill Prew
Bill Prew

Just so I can learn, how does the accepted solution resolve the problem.  It doesn't include a drive letter, and for the version of NET.EXE I have it shows the password coming before the /user: parm, not after?

~bp
and you said it works but kept disconnectng, after first saying not working?!
A bit confused here myself too and would like to learn more...
How does the accepted solution work when it doesn't include a drive letter, and how does it address the original problem of disconnection?