Command Prompt

Command Prompt, sometimes called the Command shell, is a legacy environment that dates back to the original version of Windows NT. But it is modeled after the Command.com command-line interpreter that Microsoft provided with MS-DOS, the text-based predecessor to Windows. As a result, it shares many commands with that earlier system too.
In MS-DOS and Command Prompt, scripts were originally called batch files. But a later scripting environment called Windows Script Host (WSH) provided access to more sophisticated automation capabilities.
Command Prompt is still provided in Windows for backward compatibility reasons, but Microsoft recommends that anyone needing automation capabilities today should focus on Windows PowerShell instead. While we agree with that advice, this chapter provides a few tips for using Command Prompt.
Access Command Prompt
The Command Prompt can be easily found in Start. Unlike in previous Windows versions, it is no longer a separate standalone app but is instead a command-line profile that runs in the Terminal app.

The quickest way to launch Command Prompt is to open Start and type cmd.
Sometimes, you will need to run Command Prompt as an administrator. To do so, open Start, type cmd, and then right-click on Command Prompt in the search results list and choose "Run as administrator."

Curiously, when you run Command Prompt as an administrator, it appears as a standalone app and not inside of Terminal.
Learn which commands are available
Microsoft maintains a useful Command Prompt command reference that will help you get started with some old favorites like cd (change directory), dir (directory listing), format, mkdir (make directory), and ver (version). But you can also use Command Prompt to find a list of its available commands. To do so, open Terminal to a Command Prompt tab and type:
>help

The output from this command--the list of available commands--will scroll past the bottom of the console window, hiding much of it. To see the rest, you can scroll back up with the keyboard or mouse. Or you can type the following to cause the output to pause each time it has filled the height of the window:
>help | more

Hit any key to continue listing available commands.
Learn how to use individual commands
In addition to the online command reference noted above, you can use the help command in Command Prompt to get help with an individual command. For example, to learn how to use the dir command, you would type:
>help dir

In this case, you don't need to append | more to the end of the command, as help will automatically pause each time the text has filled the height of the window.
Move more quickly around the file system
While you can use the cd command to navigate around the folder (directory) structures on your PC's storage devices, it can get pretty tedious if the folders you need to get through have long names or names with spaces. But Microsoft makes this easier by supporting folder...

Gain unlimited access to Premium articles.

With technology shaping our everyday lives, how could we not dig deeper?

Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.

Tagged with

Share post

Please check our Community Guidelines before commenting

Windows Intelligence In Your Inbox

Sign up for our new free newsletter to get three time-saving tips each Friday

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Thurrott © 2024 Thurrott LLC