Retrieving password from Windows Credential Manager using CMD

Benjamin picture Benjamin · Feb 12, 2015 · Viewed 11.5k times · Source

I am trying to add and retrieve credentials from Windows Credential Manager using a command prompt.

To add a new credential, I have the command like below and it works perfectly:

cmdkey /add:testTarget /user:testUser /pass:testPassword

However, when I try to retrieve the credentials, which I have added earlier (testTraget) using CMD, I am unable to get the password using the command below:

cmdkey /list:testTarget

The command only returns the Target(testTarget),Type(Domain Password), and the Username(testUser)

How can I retrieve the testUser password?

I know this is possible in Mac OS using Bash and keychain.

Answer

DavidPostill picture DavidPostill · Feb 12, 2015

"How can I retrieve the testUser password?"

This is not possible using cmdkey.

Reference cmdkey:

Create, list or delete stored user names, passwords or credentials.

...

Once stored, passwords are not displayed.