How can I Map a Network Drive with Password so it stays mapped after a reboot?

16

8

I mapped a network drive to a location that needs a password. Now whenever my computer starts up, it tells me that it could not connect to that network drive because a password is needed.

How do I make set my computer to remember the password for that mapped network drive?

My PC is running Windows XP Professional

Lea Cohen

Posted 2009-08-17T10:03:55.170

Reputation: 824

Answers

17

There's two was to do it - the GUI, or a command line.

GUI Method

  1. Right click 'My Computer' -> 'Disconnect Network Drive'.
  2. Select your network drive, and disconnect it.
  3. Right click 'My Computer' -> 'Map Network Drive'.
  4. Enter the path, and click 'Connect using a different username and password'
  5. Input the appropriate username and password.

Command Line

  1. Create a new batch file with the follwing:
@echo off
net use x: /delete
net use x: \\server\share /USER:COMPUTER\User password
exit

Where:

x: is your preferred drive
\\server\share is your computer name, and share name
COMPUTER\User is the computer's name (or IP) and a valid username on that PC.

Save this in your startup; and it will run when you log onto the computer. The batch file is my personal preferred method, because it overrides any stale credentials that your computer might be saving.

Also keep in mind authentication. When Windows connects to another computer, it first uses your logon information to authenticate. Normally, the guest account is enabled, which is why most computers won't prompt for a password. If that doesn't work, you need to specify an account that is on the remote computer; in the form of COMPUTERNAME\Username. You can specify COMPUTERNAME as a NetBIOS name, or you can use an IP address, such as 192.168.0.100; or whatever the case may be.

EvilChookie

Posted 2009-08-17T10:03:55.170

Reputation: 4 519

The GUI didn't help - it still didn't remember my password the next time I logged on.

The command line helped - thank you very much. – Lea Cohen – 2009-08-20T07:03:40.960

9

The solution is as answered here: How to save the password for a mapped network drive?

Map the drive using this syntax at the command prompt:

net use X: \\Hostname\Share /savecred /p:yes

It will then prompt for a username and password, which will be saved and will not prompt even after a reboot.

You can also add the credentials by opening Start → Run → control userpasswords2 → Advanced → Manage Passwords.

This feature exists on Windows XP and later.

user8228

Posted 2009-08-17T10:03:55.170

Reputation:

3

Normally when you are prompted for the password, there is a little checkbox to 'remember my password'.

If it doesn't prompt you, then maybe this kb article will help.

Where this appears to fail is if you are connecting to the server using the same username as you are using to logon into windows but with different password. (I am guessing that windows can not remember two passwords for the same name).

sgmoore

Posted 2009-08-17T10:03:55.170

Reputation: 5 961

2

If you have already stored a (possibly wrong) password, then Windows will try to use the wrong password first and then you get the prompt for entering the password. If you enter the right password, the old password is possibly not replaced.

You can check it. Click Start > Run then enter the following:

control keymgr.dll

Check if there are any stored passwords for your network drive.

Crujach

Posted 2009-08-17T10:03:55.170

Reputation: 356

1

I tried it on Windows Server 2003 (should work on any version of Windows after XP) and this is what I did with the GUI (don't need a risky batch file) to make it stay mapped after reboot:

  1. Click Start and then click on Run
  2. Type your \\ip or \\addresshere\folderifany
  3. It will prompt you for a username and password, so fill in that info.
  4. Check the box that says it will save your credentials or password.
  5. Map the network drive and enjoy.

Test it with a reboot and you will see it is still mapped.

Ozl

Posted 2009-08-17T10:03:55.170

Reputation: 632

The question is asking for a solution for Windows XP. – Der Hochstapler – 2012-07-26T00:09:00.340

1Windows Server 2003 is, effectively, the server version of Windows XP. (I know WinXP is 5.1 and WS2003 is 5.2, but 64-bit WinXP is 5.2 as well, so I wouldn't take this difference too seriously.) – RavuAlHemio – 2013-05-04T14:14:57.050

0

Credentials for network drives are only remembered until the end of the user session. This means that you will be prompted again for credentials after a log off/login, sleep or restart operation. It is possible to save credentials in a sort of "credentials vault" starting in Windows XP.

In XP: To configure this option, you go in the control panel, and then in the section for user configuration (where you set password, profile pictures etc.) you select the user you wish to configure the vault for. On the left side, there should be a "manage your network passwords" link. This is where you will add the server along with the credentials. Important note: Disconnect and remap whatever mapped drive you have made. When you re-map do NOT click the "use different username" link, simply press "Finish".

Vista and 7: The option is also inside control panel's user section but it's now called "Credential Manager". Add a "Windows credential". Important note: Disconnect and remap whatever mapped drive you have made. When you re-map do NOT click the "use different username" link, simply press "Finish".

For Windows 2000 you will have to have the same username and password on both the NAS/Server and on your PC because there is no credentials manager.

Reference: Microsoft Answers

Nikita Bosik

Posted 2009-08-17T10:03:55.170

Reputation: 101