To open Command Prompt in Windows 10, select Start, type cmd, and select Command Prompt. Or press Windows + R, type cmd, and press Enter. To run it as administrator, select Run as administrator in the search results.
Applies to: Windows 10. Checked against Microsoft Learn on September 27, 2026.
Open Command Prompt
Pick whichever way is quickest for you:
- Start search: select Start, type cmd, and select Command Prompt.
- Run box: press Windows + R, type cmd, and press Enter.
- Start menu: select Start > Windows System > Command Prompt.
- File Explorer: go to a folder, select the address bar, type cmd, and press Enter. Command Prompt opens in that folder. To start at the top of drive C, open the C drive first.
- Task Manager: press Ctrl + Shift + Esc, select File > Run new task, type cmd, and select OK.
The Windows + X menu shows Windows PowerShell by default. To show Command Prompt there instead, go to Settings > Personalization > Taskbar and turn off Replace Command Prompt with Windows PowerShell in the menu when I right-click the start button or press Windows key + X.
Open Command Prompt as administrator
Some commands, such as sfc /scannow, need administrator rights.
- Select Start and type cmd.
- Select Run as administrator in the right pane.
- Select Yes in the User Account Control box. The window title starts with Administrator.

For other ways, see how to run as administrator in Windows 10.
Change folders with cd
Use the cd command to move between folders.
- To go into a folder, type
cdand the folder name, such ascd Documents, and press Enter. - To go up one folder, type
cd ... - To switch to another drive and folder, type
cd /d D:\Projects. You can also type just the drive letter, such asD:. - To go to the top of the current drive, type
cd \.

Folder names with spaces work without quotes. Type dir to list what’s in the current folder.
Open Command Prompt in a specific folder
In File Explorer, open the folder, click in the address bar, type cmd and press Enter. Command Prompt opens already pointed at that folder, so you don’t need cd.
Open Command Prompt when Windows won’t start
If Windows fails to start twice in a row, it opens the recovery screen. Select Troubleshoot > Advanced options > Command Prompt. You can also start from a Windows 10 installation USB and press Shift + F10 on the first Setup screen. In both cases, drive letters may differ from normal, so check with dir C: and dir D: before running commands.
Close Command Prompt
Type exit and press Enter, or close the window.
Troubleshooting
- Windows + X shows PowerShell instead of Command Prompt. Go to Settings > Personalization > Taskbar and turn off Replace Command Prompt with Windows PowerShell in the menu.
- A command says “Access is denied.” Close the window and open Command Prompt as an administrator.
- Command Prompt opens and closes right away, or says it has been disabled. On a work PC, your administrator may block it. On a home PC, run a full scan in Windows Security, since some malware disables it.
- The text is tiny. Hold Ctrl and scroll the mouse wheel, or right-click the title bar and select Properties > Font.
Frequently asked questions
What’s the difference between Command Prompt and PowerShell?
Both run commands. PowerShell is newer and can do more, but most basic commands, such as cd and dir, work in both.
What can I do with Command Prompt?
For example, run an SFC scan to repair Windows files or find your IP address with ipconfig.
To run the same commands again later, save them in a batch (.bat) file.
To register a DLL file from Command Prompt, see how to register a DLL in Windows 10.
To unpack a .tar.gz file from Command Prompt, see how to open a .gz file in Windows 10.
Command Prompt also includes curl for downloading and testing web addresses. See how to use curl on Windows 10.
To compile C code, use the Developer Command Prompt that comes with Microsoft’s build tools. See how to compile and run a C program in Windows 10.
Microsoft’s guides are cmd and cd. More help is on our Windows Help & Guides page.
How do I copy and paste in Command Prompt?
In Windows 10, Ctrl + C and Ctrl + V work as usual. You can also right-click to paste. To copy, drag over the text to select it and press Enter or Ctrl + C.
Related: print a list of files in a folder.

Matt Jacobs has been working as an IT consultant for small businesses since receiving his Master’s degree in 2003. While he still does some consulting work, his primary focus now is on creating technology support content for SupportYourTech.com.
His work can be found on many websites and focuses on topics such as Microsoft Office, Apple devices, Android devices, Photoshop, and more.