Setting Which Credentials to use for Accessing a System

Q. How can I set which credentials to use for accessing a system?

A. When you connect to a new system that can't use your logged on context or your credentials are not passed automatically, you might be prompted for authentication or the access will just fail. It's possible to configure alternate sets of credentials to be used for various systems using the CMDKEY utility, which takes as parameters the target system and the credentials to use, as this example shows:

C:\Users\administrator.VIRT>cmdkey / /user:savilltech\bruce /pass:
Enter the password for 'virt\bruce' to connect to '': ****

CMDKEY: Credential added successfully.

C:\Users\administrator.VIRT>cmdkey /list

Currently stored credentials:

Type: Domain Password
User: savilltech\bruce

Type: Domain Password
The password can be contained on the actual cmdkey line, instead of prompting for it. You can remove an entry using the cmdkey /delete: command.
— John Savill
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.