windowscmdcommand-linecommand-promptcredential-manager

Retrieving password from Windows Credential Manager using CMD


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.


Solution

  • "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.