How to open the command prompt in windows

I read a set of instructions for Microsoft Windows XP that required me to “open a command prompt” before running/typing in some sort of command. How do I do that?

Most normal Windows programs, like Microsoft Word, can be run by double-clicking
an icon on the desktop or a shortcut under the Start Menu. A few programs, however,
have to be “run within a command prompt” in order to work. We’ll show an example
of how to run one of those programs called “ipconfig”.

To open a command prompt, first open a “Run” dialog box. To do this,
press Windows+R — in other words, hold down the “Windows” key on your keyboard,
and press the R key. (The “Windows” key is the key in the lower left area of the
keyboard with the Windows logo on it — usually between the “Ctrl” and the “Alt”
keys.)

When you press Windows+R, the “Run” dialog will appear:

How to open the command prompt in windows

In the text space, type “cmd” and hit Enter. Now a window will open,
looking something like this:

How to open the command prompt in windows

That’s the command prompt.
An example of a program that can only
be run inside a command prompt, is a program called “ipconfig”,
which is a Windows utility that tells you what your IP address is.
You may encounter
instructions that say something like, “Open a command prompt and run ipconfig”,
without giving more specifics that would be useful to a novice. In that case,
you would open the command prompt as shown above, and type “ipconfig” in the
command prompt, which will give you output that looks something like this:

How to open the command prompt in windows

What would have happen if you had run ipconfig outside of a command prompt? Try
pressing Windows-R to open the “Run” dialog again, and type “ipconfig” and press
Enter:

How to open the command prompt in windows

You’ll probably see a black box appear on the screen and then disappear after a
split second. What happened in this case is that the ipconfig program ran, generated
its output, and then exited — and when a Windows program exits, its window closes
and leaves no trace behind, just like any other Windows program like Microsoft Word.
In this case, however, that behavior isn’t what you want, because “ipconfig” prints
information to the screen before it exits, so when its window closes, that information
disappears too. That’s why you run “ipconfig” inside a command prompt, so that after
ipconfig exits, the command prompt window is left open to display the output.

Bennett Haselton is a technology and political blogger.
If you want to know
how to access Facebook from school,
he’s your man.

Open Command Prompt to Execute Commands in Windows 10, 8, 7, Vista, & XP

How to open the command prompt in windows

Tim Fisher has 30+ years’ professional technology experience. He focuses on support and Microsoft topics but is an expert in all areas of tech. He’s also the VP and General Manager of Lifewire.

  • Facebook
  • Twitter
  • LinkedIn
  • Tweet
  • Share
  • Email

Some popular Command Prompt commands you might have heard of include ping, netstat, tracert, shutdown, and attrib, but there are many more. We have a complete list here.

How to open the command prompt in windows

While Command Prompt probably isn’t a tool most of you will use on a regular basis, it can really come in handy now and then, maybe to troubleshoot a specific Windows problem or to automate some kind of task.

How you open Command Prompt differs between Windows versions, so you’ll find steps below for Windows 10, Windows 8 or Windows 8.1, and Windows 7, Windows Vista, and Windows XP. See What Version of Windows Do I Have? if you’re not sure.

Open Command Prompt in Windows 10

Select the Start button.

Type cmd.

How to open the command prompt in windows

Select Command Prompt from the list.

How to open the command prompt in windows

Open Command Prompt Through the Start Menu

Another way to open Command Prompt in Windows 10 is to look in its Start menu folder:

Select the Start button.

Select the Windows System folder from the list.

Choose Command Prompt from the folder group.

How to open the command prompt in windows

Open Command Prompt Using Power User Menu

One more method in Windows 10 is through the Power User Menu. If you’re using a keyboard or mouse, choose Command Prompt from the menu that appears after pressing Win+X or right-clicking the Start button.

How to open the command prompt in windows

You might see Windows PowerShell options in the Power User Menu instead of Command Prompt. In more recent versions of Windows 10, Command Prompt has been replaced by PowerShell, but you can still access it from the Power User Menu by editing the taskbar settings.

Open Command Prompt in Windows 8 or 8.1

Select the Start button and then swipe up to show the Apps screen. You can accomplish the same thing with a mouse by selecting the down arrow icon at the bottom of the screen.

Prior to the Windows 8.1 update, the Apps screen can be accessed from the Start screen by swiping up from the bottom of the screen, or right-clicking anywhere, and then choosing All apps.

If you’re using a keyboard or mouse, a really quick way to open a Command Prompt window in Windows 8 is through the Power User Menu—just hold the WIN and X keys down together, or right-click the Start button, and choose Command Prompt.

Swipe or scroll to the right on the Apps screen to locate the Windows System section heading.

Select Command Prompt. You can now execute whatever command you needed to run.

See our List of Windows 8 Command Prompt Commands for a complete list of the commands available through Command Prompt in Windows 8, including short descriptions and links to more in-depth information if we have it.

Open Command Prompt in Windows 7, Vista, or XP

Open the Start menu from the bottom-left corner of the screen.

In Windows 7 and Windows Vista, it’s a bit faster to enter command in the search box at the bottom of the Start menu and then choose Command Prompt when it appears in the results.

Go to All Programs > Accessories.

Choose Command Prompt from the list of programs.

Here’s our List of Windows 7 Commands and List of Windows XP Commands if you need a command reference for any of those versions of Windows.

Other Ways to Open Command Prompt

Command Prompt in Windows XP through Windows 10 can also be opened with a command. This is especially helpful if you like using the Run dialog box or if Windows Explorer has crashed and the Start menu is inaccessible (and thus the directions above don’t work).

To do this, enter cmd into the command-line interface. This can be in the Run dialog box (WIN+R) or Task Manager’s File > Run new task menu.

How to open the command prompt in windows

Elevated Command Prompts and Old Windows Versions

In versions of Windows released before Windows XP, like Windows 98 and Windows 95, Command Prompt doesn’t exist. However, the older and very similar MS-DOS Prompt does. This program is located in the Start menu and can be opened with the command run command.

Some commands, like the sfc command that’s used to repair Windows files, require that Command Prompt be opened as an administrator before they can be executed. You’ll know if this is the case if you get a message like one of these after trying to execute the command:

  • check that you have administrative rights
  • . command can only be executed from an elevated command prompt
  • you must be an administrator

How to open the command prompt in windows

See How to Open an Elevated Command Prompt for help starting Command Prompt as an administrator, a process that’s a bit more complicated than what’s outlined above.

How to open the command prompt in windows

If you need to run commands like mkdir , ping , and netstat in Windows, you’ll need to open the Command Prompt program.

Turns out that there are a bunch of ways to do that. We’ll cover some of the most common ways to open Command Prompt in this article.

Note: While this article was written for Windows 10, some methods should be similar for earlier versions of Windows.

How to open Command Prompt from the Windows Start Menu

First, click the Start Menu button in the lower-left corner to open the start menu.

Scroll down to “Windows System” and click that to open a dropdown of different Windows programs. Then click “Command Prompt”:

How to open the command prompt in windows

How to open Command Prompt with the search bar

One of the fastest ways to open Command Prompt is by using the search bar in the Windows 10 Taskbar.

Just type “cmd” into the search bar and click on “Command Prompt”:

How to open the command prompt in windows

How to open Command Prompt from the Run program

Windows 10 has another program called Run that lets you, well, run other programs. You can also do things like open folders and files, but that’s outside the scope of this tutorial.

To open Run, you can open the Start Menu and find it under “Windows System”. You could also type “run” in the search box and find it that way.

But the fastest way to open Run is with the shortcut Windows Key + R.

Then, once the Run window is open, just type in “cmd” and press “OK” to open Command Prompt:

How to open the command prompt in windows

How to open Command Prompt as an administrator

Some commands like powercfg or chkdsk require that you open Command Prompt as an administrator. This will give you elevated access for whatever commands you run.

To open Command Prompt as an administrator, find Command Prompt using any of the methods described earlier.

Then, right click on “Command Prompt” and click “Run as administrator”:

How to open the command prompt in windows

You may need to hover over “More” depending on the method you used to find the Command Prompt program.

Also, you may see a “User Account Control” window pop up with the message “Do you want to allow this app to make changes to your device?” Just click “Yes” to continue.

After this, you should see a Command Prompt window with “Administrator: Command Prompt” across the top:

How to open the command prompt in windows

Alternatively, you could open Command Prompt as a normal user, type in a command, and then press Ctrl + Shift + Enter to run that command as an administrator.

Note: While you should always be careful about what commands you run in Command Prompt or any other command line program, be especially mindful about what you run as an administrator. One wrong command could delete important system files and ruin your installation of Windows.

In summary

These are just some of the many ways to open Command Prompt in Windows. Go with whatever works best for you and run commands to your heart’s content.

But please, before you run any command, double check that everything is correct, especially if you opened Command Prompt as an administrator. Speaking from experience, a few extra seconds of caution could save you hours of reinstallation.

And with that, go forth and (safely) run all the commands.

Read more posts by this author.

If you read this far, tweet to the author to show them you care. Tweet a thanks

Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started

freeCodeCamp is a donor-supported tax-exempt 501(c)(3) nonprofit organization (United States Federal Tax Identification Number: 82-0779546)

Our mission: to help people learn to code for free. We accomplish this by creating thousands of videos, articles, and interactive coding lessons – all freely available to the public. We also have thousands of freeCodeCamp study groups around the world.

Donations to freeCodeCamp go toward our education initiatives and help pay for servers, services, and staff.

By Alisa | Follow | Last Updated August 04, 2021

Summary :

How to open the command prompt in windows

Wonder how to open a file cmd or how to open a folder in Command Prompt on Windows 10? This tutorial provides a step-by-step guide. Also, if you can’t find some files or folders in Windows 10, or some files are unexpectedly lost in your Windows 10 computer, MiniTool free data recovery software for Windows 10/8/7 can help you easily recover lost files.

You can also open files from Command Prompt. Wonder how to open a file or folder in Command Prompt on Windows 10? Check the step-by-step guide in this tutorial.

How to Open a File CMD Windows 10 in 2 Steps

Step 1 – Open Command Prompt

You can press Windows + R keys on the keyboard to open Windows Run dialog. Then type cmd in the Run box. If you want to run Command Prompt as Administrator, you need to press Ctrl + Shift + Enter keys at the same time.

Alternatively, you can also click Start or Search box in Windows 10, and type cmd or command prompt. Right-click the Command Prompt app in the list and choose Run as administrator.

Step 2 – Open Files from Command Prompt

Normally you have two ways to open a file using cmd. One is to move the folder that the file is in, the other is to open the files directly in Command Prompt.

Method 1. How to open a file with cmd by moving to the folder firstly

  • You can use the cd command to move to the exact folder the file lies in. For instance, cd C:\Users\mini\Desktop.
  • After you are in the correct folder path, you can type the name of the file with its extension, e.g. “travel.png”, and hit Enter button to open it.

How to open the command prompt in windows

How to open the command prompt in windows

Learn how to open/use the Add or Remove Programs feature to uninstall apps on Windows 10/11. Some other ways to delete apps on Windows 11/10 are also included.

Method 2. How to open a file using cmd directly

You can also choose to open files from Command Prompt on Windows 10 directly, instead of going to the folder path. You can input the full path, file name and its file extension to open the target file, e.g. “C:\Users\mini\Desktop\travel.png”.

How to open the command prompt in windows

You can also freely specify an app to open the file. You need to type the whole path of the app ahead of the path of the file. For example, C:\Users\mini\”%windir%\system32\mspaint.exe” “C:\Users\mini\Desktop\travel.png”.

How to open the command prompt in windows

Detailed guide for how to uninstall a program by using CMD (Command Prompt) or PowerShell utility on Windows 10/11.

How to Open a Folder in Command Prompt Windows 10

You can also open a folder from Command Prompt with the command line below.

After you enter into Command Prompt window by following the operation above, you can open a folder in File Explorer in Command Prompt. The command line can be like this, start %windir%\explorer.exe “C:\Users\mini\Desktop”.

How to open the command prompt in windows

Tip: Need to mention that you need to enclose the path of a file or folder in double quotation marks, since some folder or files names have spaces in them.

To Recover Unexpectedly Lost Files or Folders in Windows 10

Sometimes you may suffer unexpected data loss in Windows 10 due to various reasons, e.g. system crash, Blue Screen error (e.g. Bad Pool Caller BSOD error), power outage, malware/virus infection, hard drive failure, etc. To easily recover lost data for free, you can choose the best free data recovery software to realize it.

MiniTool Power Data Recovery, a 100% clean and free data recovery software for Windows 10/8/7, enables you to easily recover mistakenly deleted files or lost files from computer local drive, external hard drive, SSD drive, USB drive (pen drive data recovery), SD card, and more.

How to open the command prompt in windows

Check how to download DirectX 12 (Ultimate) for Windows 10 or Windows 11 PC for better gaming experience. Also learn what is DirectX 12 (Ultimate) in this post.

  • Facebook
  • Twitter
  • Linkedin
  • Reddit

ABOUT THE AUTHOR

How to open the command prompt in windows

Position: Columnist

Alisa is a professional English editor with 4-year experience. She loves writing and focuses on sharing detailed solutions and thoughts for computer problems, data recovery & backup, digital gadgets, tech news, etc. Through her articles, users can always easily get related problems solved and find what they want. In spare time, she likes basketball, badminton, tennis, cycling, running, and singing. She is very funny and energetic in life, and always brings friends lots of laughs.

If you want to know how to open Command Prompt in Windows, there are several methods that you can utilize. Read up on the simple instructions below. But first, let’s take a look at what the Command Prompt is and what it does.

What is Command Prompt?

Command Prompt is a program that you can use to execute commands on a Windows computer. This tool is handy for troubleshooting or for setting automated tasks in the Windows operating system.

Command Prompt can help you find your IP address, perform system repairs, and other advanced admin functions. If you’re familiar with macOS, the Command Prompt is similar to the Terminal App.

Warning: Making changes in Command Prompt can damage your computer. If you don’t know what you’re doing, we recommend contacting a tech professional before you do anything in Command Prompt.

How to open the command prompt in windows

There are several ways of opening Command Prompt, depending on which operating system you are running.

Open Command Prompt With the Run Window

Every recent version of Windows has come with the Run window, which can be used to open Command Prompt. Here’s how:

  1. Press the Windows + R keys on your keyboard.How to open the command prompt in windows
  2. Type “cmd” in the search box.
  3. Then click OK or press Enter.How to open the command prompt in windows

Open Command Prompt in Applications

Another way to open Command Prompt in Windows 10 is by going to the Start menu folder. Here are the steps:

  1. Click on the Start button.
  2. Scroll down the list of apps until your see the “Windows System” folder.
  3. Click on Windows System.
  4. Then click on Command Prompt.How to open the command prompt in windows

How to open the command prompt in windows

How to Open Command Prompt in Windows 8.1

If you are running Windows 8.1, you can open the Command Prompt by following the steps below:

  1. Click the Start screen.
  2. Tap All Apps.
  3. Go to the Windows System folder.
  4. Click Command Prompt.

How to open the command prompt in windows

Use the Search Button

  1. Click on the Search button. This is located in the bottom left corner of your screen, and it is shaped like a magnifying glass.
  2. Type “cmd” or ‘command” in the search field.
  3. Select Command Prompt from the results.

How to open the command prompt in windows

Run Command Prompt as Administrator

If you wish to use the tool with administrative privileges, follow the steps below on how to run Command Prompt as administrator:

  1. Type “CMD” or “command” in the taskbar search field.
  2. Right-click on the Command Prompt search result.
  3. Click Run as administrator.

How to open the command prompt in windows

Now that you know how to open Command Prompt, check out our article on the most useful Command Prompt commands here.

How to open the command prompt in windows

Windows, MacOS and Linux have command line interfaces. Windows’ default command line is the command prompt. The command prompt allows users to use their computer without pointing and clicking with a mouse.

The command prompt is a black screen where users type commands to use their computer. The same tasks that can be done by pointing and clicking with a mouse can also be done with the command prompt. The difference is that many tasks such as creating folders and deleting files can be done faster in the command prompt.

Also, it allows users to configure their computer and run programs that they otherwise could not do by pointing and clicking.

Opening the Command Prompt

To access the command prompt, click the windows start menu on the Desktop tool bar (you can also press the windows button on your keyboard) and type cmd and hit enter . The command prompt will appear, it will display some text like to following below:

Navigating Directories (Moving through folders)

C:\Users\YourUserName is called your current working directory (directory is another way to say folder). It is like a street address that tells you where you are on your computer.

The current working directory can be a guide as you navigate through your computer. On the right of the > we can type cd , which stands for Change Directory, and the name of a directory that you want to navigate to. In this case we will type Documents . Enter cd Documents and your current working directory should look like the following:

To go back one directory type and enter cd.. . Your current working directory should return to this:

With the cd and cd .. commands you can move back and forth through directories. This might seem very basic at first but as you learn more commands the command prompt will become a very useful and efficient tool.

Here is a list of common commands:

How to open the command prompt in windows

Usage Examples:

Making a Directory

Getting Info on a Command

Deleting a File and Contents

Useful tips:

  • The command Ipconfig shows your computer’s ip address
  • If you type part of a directory’s name and hit the tab key the command prompt will autocomplete it and if you hit the tab key repeatedly it will cycle through directories that start with the same letter
  • You can use other shells or tools such as git bash or cmder to add more commands and functionality to your command prompt
  • Some tasks require you to run the command prompt as an administrator you clicking the windows button and typing cmd admin and hit the enter key
  • If you know the path to a file or directory can type cd PATH_TO_YOUR_DIRECTORY instead of changing directories several times to get to a directory or file
  • When you hit the up arrow key your previously entered command will appear and if you hit it repeatedly it will cycle through all of your previously entered commands

If this article was helpful, tweet it.

Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started

freeCodeCamp is a donor-supported tax-exempt 501(c)(3) nonprofit organization (United States Federal Tax Identification Number: 82-0779546)

Our mission: to help people learn to code for free. We accomplish this by creating thousands of videos, articles, and interactive coding lessons – all freely available to the public. We also have thousands of freeCodeCamp study groups around the world.

Donations to freeCodeCamp go toward our education initiatives and help pay for servers, services, and staff.

If you want to know how to open Command Prompt in Windows, there are several methods that you can utilize. Read up on the simple instructions below. But first, let’s take a look at what the Command Prompt is and what it does.

What is Command Prompt?

Command Prompt is a program that you can use to execute commands on a Windows computer. This tool is handy for troubleshooting or for setting automated tasks in the Windows operating system.

Command Prompt can help you find your IP address, perform system repairs, and other advanced admin functions. If you’re familiar with macOS, the Command Prompt is similar to the Terminal App.

Warning: Making changes in Command Prompt can damage your computer. If you don’t know what you’re doing, we recommend contacting a tech professional before you do anything in Command Prompt.

How to open the command prompt in windows

There are several ways of opening Command Prompt, depending on which operating system you are running.

Open Command Prompt With the Run Window

Every recent version of Windows has come with the Run window, which can be used to open Command Prompt. Here’s how:

  1. Press the Windows + R keys on your keyboard.How to open the command prompt in windows
  2. Type “cmd” in the search box.
  3. Then click OK or press Enter.How to open the command prompt in windows

Open Command Prompt in Applications

Another way to open Command Prompt in Windows 10 is by going to the Start menu folder. Here are the steps:

  1. Click on the Start button.
  2. Scroll down the list of apps until your see the “Windows System” folder.
  3. Click on Windows System.
  4. Then click on Command Prompt.How to open the command prompt in windows

How to open the command prompt in windows

How to Open Command Prompt in Windows 8.1

If you are running Windows 8.1, you can open the Command Prompt by following the steps below:

  1. Click the Start screen.
  2. Tap All Apps.
  3. Go to the Windows System folder.
  4. Click Command Prompt.

How to open the command prompt in windows

Use the Search Button

  1. Click on the Search button. This is located in the bottom left corner of your screen, and it is shaped like a magnifying glass.
  2. Type “cmd” or ‘command” in the search field.
  3. Select Command Prompt from the results.

How to open the command prompt in windows

Run Command Prompt as Administrator

If you wish to use the tool with administrative privileges, follow the steps below on how to run Command Prompt as administrator:

  1. Type “CMD” or “command” in the taskbar search field.
  2. Right-click on the Command Prompt search result.
  3. Click Run as administrator.

How to open the command prompt in windows

Now that you know how to open Command Prompt, check out our article on the most useful Command Prompt commands here.

Command Prompt is available in most Windows operating systems

How to open the command prompt in windows

Tim Fisher has 30+ years’ professional technology experience. He focuses on support and Microsoft topics but is an expert in all areas of tech. He’s also the VP and General Manager of Lifewire.

  • Facebook
  • Twitter
  • LinkedIn
  • Tweet
  • Share
  • Email

Command Prompt is a command line interpreter application available in most Windows operating systems. It’s used to execute entered commands. Most of those commands automate tasks via scripts and batch files, perform advanced administrative functions, and troubleshoot or solve certain kinds of Windows issues.

Command Prompt is officially called Windows Command Processor, but it’s also sometimes referred to as ​the command shell or cmd prompt, or even by its filename, cmd.exe.

How to open the command prompt in windows

Command Prompt is sometimes incorrectly referred to as “the DOS prompt” or as MS-DOS itself. Command Prompt is a Windows program that emulates many of the command line abilities available in MS-DOS, but it’s not MS-DOS.

Cmd is also an abbreviation for many other technology terms like centralized message distribution, color monitor display, and common management database, but none of them have anything to do with Command Prompt.

How to Access Command Prompt

There are several ways to open Command Prompt, but the “normal” method is via the Command Prompt shortcut located in the Start menu or on the Apps screen, depending on your version of Windows.

How to open the command prompt in windows

The shortcut is faster for most people, but another way to access Command Prompt is via the cmd Run command. You can also open cmd.exe from its original location:

Yet another method for opening Command Prompt in some versions of Windows is through the Power User Menu. However, you might see PowerShell there instead of Command Prompt depending on how your computer is set up.

Many commands can only be executed if you’re running the Command Prompt as an administrator.

How to Use Command Prompt

To use Command Prompt, you enter a valid Command Prompt command along with any optional parameters. Command Prompt then executes the command as entered and performs the task or function it’s designed to perform in Windows.

For example, executing the following Command Prompt command in your Downloads folder would remove all MP3s from that folder:

Commands must be entered into Command Prompt exactly. The wrong syntax or a misspelling could cause the command to fail or worse; it could execute the wrong command or the right command in the wrong way. A comfort level with reading command syntax is recommended.

For example, executing the dir command will show a list of files and folders that exist at any specific location on the computer, but it doesn’t actually do anything. However, change just a couple letters and it turns into the del command, which is how you delete files from Command Prompt!

Syntax is so important that with some commands, especially the delete command, adding even a single space can mean deleting entirely different data.

Here’s an example where the space in the command breaks the line into two sections, essentially creating two commands where the files in the root folder (files) are deleted instead of the files in the subfolder (music):

The proper way to execute that command so as to remove files from the music folder instead is to remove the space so that the whole command is strung together correctly.

Don’t let this scare you away from using Command Prompt commands, but definitely let it make you cautious.

Command Prompt Commands

A large number of commands exist in Command Prompt, but their availability differs from operating system to operating system. You can view which Command Prompt commands are compatible with a specific operating system here:

  • Windows 8 Commands
  • Windows 7 Commands
  • Windows XP Commands

Following those command lists will prove that there are lots and lots of commands you can use in Command Prompt, but not all of them are used as often as others.

Here are some of the more commonly used Command Prompt commands that are utilized in a variety of circumstances: chkdsk, copy, ftp, del, format, ping, attrib, net, dir, help, and shutdown.

Command Prompt Availability

Command Prompt is available on every Windows NT-based operating system which includes Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, and Windows 2000, as well as Windows Server 2012, 2008, and 2003.

Windows PowerShell, an advanced command line interpreter available in recent Windows versions, supplements the command executing abilities available in Command Prompt. Windows PowerShell may eventually replace the Command Prompt in a future version of Windows.

Windows Terminal is another Microsoft-approved way of using Command Prompt and PowerShell within the same tool.