What Is cmdkey.exe & How Do I Use It
Comprehensive guide on how to effectively use cmdkey.exe on Windows OS

Your Windows device comes with various command line tools, including cmdkey.exe. In previous guides, we have talked about other command line tools like Bash.exe and bthudtask.exe, but in this article, we will focus on the cmdkey.exe file.
We will cover everything you need to know about this file and help you discover how to use this command line tool efficiently.
What is Cmdkey in Windows?
Cmdkey.exe is a command-line utility that allows users to create, list, and remove stored usernames, passwords, or credentials on the Windows platform.
This utility is connected to the Credential Manager, an integral constituent of Windows dedicated to preserving and safeguarding your login credentials for websites, networks, and applications.
What is the use of Cmdkey?
- Logging into remote computers using Remote Desktop Connection
- Connecting to network shares
- Signing in to websites
How do I use cmdkey.exe in Windows?
1. Viewing all possible commands
- Press Windows + R to open the Run dialogue box, type cmd in the text field, then hold Ctrl + Shift + Enter to open the command prompt with administrative privileges.
- Once the command prompt is opened, input the command below and hit Enter. This command will display all available options to use with cmdkey.
cmdkey /?
- You can use the options available to work with the cmdkey.exe process.
2. Creating a new credential
- Press Windows + R to open the Run dialogue box, type cmd in the text field, then hold Ctrl + Shift + Enter to open the command prompt with administrative privileges.
- In the command prompt, input the command below and hit Enter.
cmdkey /add:TargetName /user:UserName /pass:Password
- TargetName should be replaced with the name of the remote computer or network share, UserName should be replaced with the username for the remote computer and Password should be swapped with the password for the remote computer.
3. Export stored credentials
- Press Windows + R to open the Run dialogue box, type cmd in the text field, then hold Ctrl + Shift + Enter to open the command prompt with administrative privileges.
- In the command prompt, input the command below and hit Enter. Swap FileName with the actual name of the file you want to export.
cmdkey /export:FileName
- This process will help you export any file of your choice.
4. Import stored credentials
- Launch the command prompt in administrator mode by following the steps listed above.
- In the command prompt, input the command below and hit Enter.
cmdkey /import:FileName
- This will allow you to import any file of your choice.
5. Delete stored credentials
- Open the command prompt in administrator mode by following the steps listed above.
- In the command prompt, input the command below and hit Enter.
cmdkey /delete:TargetName
- This should allow you to delete any file of your choice.
6. List stored credentials
- Open your command prompt in administrator mode.
- Paste the command below in the command prompt.
cmdkey /list
- A list of all your stored credentials will be displayed.
In conclusion, following the steps listed in this article will help you successfully utilize the cmdkey.exe command line tool. If you have further questions, let us know in the comment section below.