I'm trying to add network login credentials for applications running
'as administrator' by using cmdkey:

 To create domain credentials:
cmdkey /add:targetname /user:username /pass:password

But getting this error when running under admin profile:

CMDKEY: Credentials cannot be saved from this logon session.

Is there possibility to store network credentials for applications running 'as administrator'?

1 Answer 1


I also met the same problem on an WindowsXP computer, and I found the solution through google:
just run gpedit.msc, location to the Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options\ branch, and set the policy Network Access: Do not allow storage of credentials or .NET Passports for network authentication value to Disable.

(if you can't change the value even you logon as an administrator, it means this policy is defined by GroupPolicy, you need to contact your Domain Administrator to change it).

Here's the link:


  • On Windows 10, this was already Disabled. Maybe the policy location or name has changed since WinXP? Dec 18, 2019 at 21:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .