Batch File to Reconnect to Mapped Drive

E

EER

Hello!

I have set my PC to auto logon. Since I have a mapped
drive, it asks for me to enter the password to the mapped
drive (since the username and password are different than
what I use to logon to my PC). However, I need my PC to
logon completely so that other critical programs (set to
start upon logon) can run in the event of a power failure
and I am not around. I have tried to use the
automatically reconnect feature with another username and
password in Windows. However, after a reboot, it always
sits there until I enter the username and password for
the mapped drive. I have had others verify this same
behavior. I would like to write a batch file so that the
mapped drive can automatically connect with a different
username and password. Can anyone provide suggestions or
examples of a batch file? I have never written a batch
file.

Thank you in advance!
 
M

Mike Brown - Process Manager

EER said:
Hello!

I have set my PC to auto logon. Since I have a mapped
drive, it asks for me to enter the password to the mapped
drive (since the username and password are different than
what I use to logon to my PC). However, I need my PC to
logon completely so that other critical programs (set to
start upon logon) can run in the event of a power failure
and I am not around. I have tried to use the
automatically reconnect feature with another username and
password in Windows. However, after a reboot, it always
sits there until I enter the username and password for
the mapped drive. I have had others verify this same
behavior. I would like to write a batch file so that the
mapped drive can automatically connect with a different
username and password. Can anyone provide suggestions or
examples of a batch file? I have never written a batch
file.

Thank you in advance!

Create a batch file and place it in your Startup folder, using the NET USE
command.

NET USE /? at the cmd prompt for info:

Of course, to send the password in this manner assumes that you are not
concerned about security :)


--

Mike Brown
Process Manager

Asset Forwarding Corp.
EPA-compliant Recycling
DoD 5220.22-M Data Elimination
http://www.assetforwarding.com
 
J

Jerold Schulman

Hello!

I have set my PC to auto logon. Since I have a mapped
drive, it asks for me to enter the password to the mapped
drive (since the username and password are different than
what I use to logon to my PC). However, I need my PC to
logon completely so that other critical programs (set to
start upon logon) can run in the event of a power failure
and I am not around. I have tried to use the
automatically reconnect feature with another username and
password in Windows. However, after a reboot, it always
sits there until I enter the username and password for
the mapped drive. I have had others verify this same
behavior. I would like to write a batch file so that the
mapped drive can automatically connect with a different
username and password. Can anyone provide suggestions or
examples of a batch file? I have never written a batch
file.

Thank you in advance!

@echo off
net use x: \\Computer\Share password /User:[Domain\]Username /persistent:no


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
B

Bob

Here is a VB script that you could use at logon. this
will map a drive with credentials.

Dim IPCC
set IPCC = createobject("wScript.Network")
IPCC.MapNetworkDrive "X:", "\\SERVER\SHARE", "False", "ACC
OUNT", "PASSWORD"

The TRUE or FaLSE is for a persistant connection. If the
connection is persistant you may run into some problems
with a drive being already mapped. Try it both ways and
see. The ACCOUNT is your username. If you ned one that
checks for the existance of a drive and deltes and remaps
it I can give you that too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top