Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapping a network drive and having trouble saving password

I'm running a batch:

"net use j: \\192.168.1.241\sausb /user:srvfeskar\administrator Ratata12 /persistent:yes /p:yes"

After restarting the windows 8 computer. I need to insert the password again.

like image 438
Stian Størstfeskar Andersen Avatar asked Mar 27 '14 07:03

Stian Størstfeskar Andersen


People also ask

Where are network drive passwords stored?

Open Control Panel, Credential Manager, Windows Credentials tab. Server Credentials are stored here. The login credential is there, along with the Server it belongs to. You can also back credentials up in here (Windows Vault).

How do I save my network credentials in Windows 10?

Go to Control Panel > User accounts. From there, navigate to Credential Manager > Windows Credentials. You will see a field Add Windows Credentials, tap on it. In this menu, you can add the computer's name you want to access, username and password.


2 Answers

If i understand it, you are not running the same command each time after restart. You want to run the command once and then in sucessive logins have the drive mapped without having to validate.

There are two options

  • In net use j: command include the /persistent:yes and /savecred switches, but do not include user or password data. It will be asked and then saved for later use.

  • Use the cmdkey command to store the required credentials in the machine.

    cmdkey /add:191.168.1.241 /user:srvfeskar\administrator /pass:Ratata12

    Then when net use j: \\192.168.1.241\sausb /persistent:yes is used, the credentials stored will be used for the mapping.

like image 56
MC ND Avatar answered Sep 29 '22 20:09

MC ND


/persistent and /savecred are mutually exclusive, and savecred cannot be used with a drive letter, you have to type two commands as follows:

net use j: \\192.168.1.241\sausb /user:srvfeskar\administrator Ratata12 /persistent:yes 
net use \\192.168.1.241\sausb /SAVECRED
like image 37
Alain Bourgeois Avatar answered Sep 29 '22 19:09

Alain Bourgeois