how to save credentials of network shares in windows

Whenever we try to access a network share it will prompt for credentials based on the shared folder settings.

Like the below prompt



Once you save them, they are saved in Windows Credentials of Credentials Manager in Control panel (run --> control keymgr.dll).



But not able to found exact file or registry for this setting.


So, can anyone suggest how to do this process of adding network credentials using scripting.

0 Comments   [ + ] Show comments

Answers (1)

Posted by: SMal.tmcc 4 years ago
Red Belt
you would use the "net use" command and add the persistent switch.

/persistent: { yes | no } : Controls the use of persistent network connections. The default is the setting used last. Deviceless connections are not persistent. Yes saves all connections as they are made, and restores them at next logon. No does not save the connection being made or subsequent connections. Existing connections are restored at the next logon. Use /delete to remove persistent connections.



since you marked autoit


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ