Mapping a network drive and having trouble saving password

Deadly 提交于 2021-02-18 05:07:03

问题


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.


回答1:


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.




回答2:


/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


来源:https://stackoverflow.com/questions/22680957/mapping-a-network-drive-and-having-trouble-saving-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!