Working with Command Prompt commands in Windows 10

Typing commands in a big black screen was the only option we had at the time of dos. Nowadays we have Windows 10 and we prefer to do everything with the mouse. If we do have to work with the Command Prompt, then it really takes some getting used to. In this article, we will guide you through the main Command Prompt commands.

We’ll cover quite a few shortcuts in this article, but we’ll start with the most important ones. Namely, there are two ways to start the Command Prompt, without and with administrator rights. The difference is that without administrator rights, the Command Prompt can hardly change any settings and can only execute simple commands, such as starting programs, displaying a directory and so on. To start the program with administrator rights you normally click on Start, you type CMD and right click on Command Prompt and click on Run as administrator.

This is also possible with a key combination. Press the Windows key on your keyboard, type cmd and press Ctrl + Shift + Enter to run the Command Prompt as administrator. In this article, we don’t run commands that require those permissions, but it is helpful to know how to enable this mode when you need it.

Navigate in Command Prompt

When you want to move somewhere in Windows 10, just move the mouse to the right place and you’re there. With the keyboard in the Command Prompt that is a bit more cumbersome, because in principle you have to press an arrow key once for each position to the side or up. This is quite annoying with a very long command. Fortunately, there are keyboard shortcuts you can apply here. For example, if you press the Home or End key, the cursor jumps to the beginning or end of the current line. Press Ctrl in combination with the left or right arrow, the cursor will jump to the previous or next word respectively.

In the Command Prompt you can easily move the cursor left or right, but not up or down; that works slightly differently. If for some reason it is necessary, it is good to know that you can activate the marking mode with Ctrl + M. This means that you can move up and down freely with the cursor, for example to select text.

Select and edit text

Selecting text in the Command Prompt is a breeze with the right keyboard shortcuts. With the key combination Ctrl + A you select all text on the line (in highlight mode you select everything). Shift + Arrow Left or Right select one character more on the left or right respectively. If you also add the Ctrl, so Ctrl + Shift + Arrow Left or Right, you select a whole word more on the left or right side of the cursor.

Shift + Up or Down Arrow key selects the entire line, plus the line above (or below), up to the position of the cursor on that line. Shift + Home extends the current selection to the beginning of a command. If you press this key combination again, you also select the part that you did not type yourself (such as C: Windows system32). Shift + End extends the current selection to the end of the current line.

Selecting text is one thing, but of course you also want to do something with it. You already know the key combination Ctrl + C and Ctrl + V for copy and paste respectively. In Command Prompt these key combinations also work. Alternatively, you can also use Ctrl + Insert (to replace Ctrl + C) or Shift + Insert (to replace Ctrl + V). You also know that you can delete characters using the Backspace key, but did you know that you can also suddenly delete an entire word? You do this using the Ctrl + Backspace key combination.

Sometimes you want to navigate to a folder structure in Command Prompt. If these are short names, that’s no problem, but sometimes a folder name can be very long. In that case, type the first few characters of that name and then press Tab. If there are no other folders starting with the same letters, the entire folder name will be completed automatically.

Request history

When you give a command in Command Prompt and you press Enter, the text disappears upwards and you can no longer see what you have done (unless you scroll all the way up). But that doesn’t mean your actions have disappeared. Use handy shortcuts to retrieve commands you gave earlier in this session. If you close the program, all commands have disappeared.

By pressing Up Arrow, you scroll one by one through the previous commands. Fine if there are ten, but cumbersome if there are a hundred. In that case you can also type part of the command. If you then press F8, you scroll through all the commands you have typed starting with the same characters. This way you can very efficiently search for the right command.

For a complete overview of all commands you typed in this session, press F7. You can scroll through that overview with the arrow keys and press Enter to execute the command. If for some reason you want to clear all commands, you can close Command Prompt, but pressing Alt + F7 will have the same effect.

More commands

You now know how to work efficiently in the Command Prompt. Time for some handy commands!

cd (change directory)

With this command you open a folder. If you click on the Windows folder in the Explorer, type in Command Prompt CD Windows. If you are already in a folder, then type CD.. to go up one folder, or CD to go all the way to the root folder.

dir (directory)

To open a folder, you need to know which folders are there and what they are called. When you dir Command Prompt immediately displays a list of all folders. If there are more than fit in an overview, type dir / w to list all folders in rows, or dir / p to show all folders and pause the list until you press a key again.

Other station

Sometimes you want to open not only another folder, but also a completely different drive. Let’s say you are on the C drive, and you want to open the D drive. All you have to do then is D: and you are now on the other disk.

Create / delete folders

Not only can you view things with Command Prompt, you can also edit them. For example, you can easily create and delete folders using a command. Suppose you want to create a folder “test”. Then navigate with the command CD to the folder where you want to create that folder, and type md test. You don’t get confirmation that the command was successful, but the directory was created (the irony is that Command Prompt only says something if it failed). Through rd test typing delete the folder again.

Run file

In Windows you usually start a program by clicking on the icon. This works slightly differently in Command Prompt. Navigate to the folder containing the program you want to start and type dir, to see what the exe (cutable) file is called. You can optionally type dir .exe to show only the exe files. Now type the name of the program, such as Winword.exe, and press Enter to start the program.

Exit command prompt

Of course, we don’t need to explain how to close a window in Windows. However, when you learn to do more and more with the keyboard, it is inconvenient to have to grab the mouse. Fortunately, there is also a key combination for this, namely Alt + F4. When you press this key combination, the window will be closed immediately, without a verification question.


Recent Articles

Related Stories