Windows Command Prompt - The ultimate 2024 edition

Windows Prompt Command 2024 Blog

Today, most users ignore the Windows Command Prompt, as we can perform just about anything using the graphical interface. It’s easier, right? Well, why does Windows keep its prompt, then?

Although it’s almost 50 years old, it is not outdated. On the contrary, it’s very popular, and many find it incredibly useful. It has stood the test of time, so its existence is a sufficient reason to get familiar with it. It is the best way to perform many tasks, even in the modern age. Moreover, it’s pretty easy to use.

So, let’s get right to it! We’ll explain the basics of the command prompt Window, teach you how to open the Windows prompt command line, and give you a cheat sheet of the most popular CMD commands and what they do in more detail.

What Is Windows Command Line?

A command prompt or prompt is a command-line interface (CLI), a text-based user interface (UI) that enables you to perform various tasks within an OS or a program. For instance, you can interact with your computer, manage files and directories, run programs, script, automate, or perform other basic and advanced tasks.

Some operating systems provide you with a CLI exclusively, while others might grant you both a CLI and a GUI.

The Command Prompt or cmd.exe is the default command-line interpreter in Microsoft Windows, OS/2, eComStation, ArcaOS, and ReactOS operating systems. More precisely, it executes the commands you input in the Windows OS, like Terminal on macOS and Shell on Unix-based systems.

Both CLIs and GUIs are shells, programs that enable you to give commands to the computer. However, a CLI differs from a GUI, as the Graphical User Interface allows you to interact with the system using graphical elements, such as icons or menus, instead of text.

History of CMD Commands

Text-based commands go back to the existence of the Windows PC. Users could operate early Windows operating systems exclusively through CLIs; they didn’t have the mouse cursor or similar GUI elements.

Question: When did the CMD commands become available?

Answer: The Windows Prompt became available in December 1987. Virtually, Microsoft hasn’t changed its design since then. Yet, we officially recognize them as CMD commands in Windows 10, 8, 7, Vista, and XP.

The commands in earlier versions, including Windows 98/95, were known as DOS commands. Up to the 2000s, Windows versions included the MS-DOS integration, and clients ran commands using the MS-DOS Prompt. Later, starting with Windows XP in 2001, it was renamed Command Prompt.

Why Would You Use The Command Prompt?

Many customers haven’t even touched the Windows Command Prompt because modern, streamlined operating systems remove the need for old-school text commands. And sure, it might feel inconvenient to perform some tasks, such as managing files and folders using the command line, especially if you are used to the GUI.

Still, the command line is incredibly handy for many tasks, such as checking your IP address. Moreover, while it works at a basic level, the CMD is, in reality, the more powerful alternative.

It translates dozens of clicks in the GUI into a single line, thus shortening the time it takes to execute a new task. Power users also prefer it because it grants them more control over their computers and establishes direct communication.

Using the command window, you can perform advanced tasks, such as creating shortcuts to pin to the taskbar, accessing vital information, managing security issues, or fixing faults in Windows. Moreover, you can access parts of the operating system that are unavailable through the graphical user interface.

Last but not least, some of these commands apply to Linux, macOS, and many other operating systems, not only the Windows environment. So, learning them once may also benefit you in the future, even if you switch to another OS.

How To Open the Windows Command Line?

You can open the Command Prompt in Windows in a few ways:

  • Start Menu > Type “command prompt” > Press Enter

A screenshot from Windows PC displaying how to open the command prompt from the start menu.
  • Start Menu > Type “cmd” > Press Enter

A screenshot from Windows PC displaying how to open the command window from the start menu.
  • Press Win + R > Type “cmd” > Press Enter

A screenshot displaying how to open ports from the Run command dialog box on a Windows.
  • Right-click the Start Menu > Choose Command Prompt

  • Press Win + X > Choose Command Prompt

The Command Prompt in the Start Menu might also appear as Windows PowerShell or Windows Terminal, depending on your Windows settings. Both are more powerful yet compatible with CMD commands.

A screenshot of the Start Menu on a Windows, displaying the PowerShell option and clipboard-related topics.

Yet, remember that some commands require administrator access. To open a command prompt and perform some of the commands, make sure to choose the Admin option from the menu. For the other ways to open the CMD, hold Ctrl + Shift to get admin permission when you launch.

How To Use the Windows Command Line?

As soon as you open the command prompt, you’ll immediately learn a lot.

The first line shows you your Windows version. In my case, that’s 10.0.19045.2486. Also, pay attention to the third line, i.e., C:\Users\[Username]>. It refers to the Windows user and tells you where your commands will take place if CMD relies on location. Some CMD commands, however, are general. So, your location won’t matter.

A screenshot as an example of the command window.

Question: How many commands are there in CMD?

Answer: While the exact number of commands differs according to your Windows version, you can use approximately 100 commands.

The commands are not case-sensitive. Yet, as you are issuing them directly, try to type in the command correctly. Otherwise, the system won’t be able to understand you. But worry not; you cannot do much harm with a typo. If Windows doesn’t recognize the command, you’ll get a message saying: ‘[Command]’ is not recognized as an internal or external command, operable program, or batch file.

An example of a typo and the error message in an open command prompt.

However, typing the wrong command sure does some damage. If Windows recognizes the command, it will execute it immediately. So, it would be best to take your time and double-check everything. Moreover, avoid using the admin Command Prompt unless necessary.

Windows Command Prompt Cheat Sheet

Finally, we come to the most used commands in Windows OS. You can keep the list open on your desktop or print it; either way, keep it near to make the most out of CMD without feeling overwhelmed.

Basic Commands

Even if you have never used the command prompt window, some of its commands are welcoming to beginners.

Here’s a quick summary to help you start with the basics and build your knowledge:

  • Any command/?: Gives you information about the specific command and what it does

  • ARROW DOWN: Enables you to move forward in history toward the most recent command

  • ARROW UP: Enables you to step through the last called commands from the most recent one

  • call: Tells batch programs from one another

  • cd (change directory): Displays the name of or changes the current directory

  • chkdsk: Scans a disk for errors and delivers a status report

  • cls: Clears the contents of the Command Prompt

  • color: Applies the default console colors

  • Ctrl+A: Moves the caret to the beginning of the line

  • Ctrl+C: Cancels a command you are running

  • Ctrl+E: Moves the caret to the end of the line

  • Ctrl+K: Deletes all characters after the caret

  • Ctrl+L: Clears the screen

  • Ctrl+U: Deletes all characters before the caret

  • date: Displays or sets the date

  • del [file name]: Deletes the selected file

  • dir (directory): Lists all the files and subdirectories in the directory you are currently in

  • echo: Presents messages or turns command-echoing on/off.

  • exit: Quits the current echo setting or the CMD.EXE program

  • find: Searches for a text string in one or multiple files

  • help: Lists many common commands you can use

  • hostname: Prints the name of the current host

  • ipconfig: Provides a network overview for your current connection

  • mkdir [new folder name] (make directory): Creates a new folder

  • pause: Suspends processing of a batch program and displays the message

  • ping: Checks if your computer can reach a remote destination and how long it will take

  • prompt: Specifies a new command prompt

  • rmdir [folder name] (remove directory): Deletes an entire folder if it’s empty

  • sfc: Windows detects and fixes corrupt system files *you need admin access

  • TAB: Autocompletes what you have been writing

  • title: Sets the window title for the command prompt window

Once you get familiar with the basics, it’s time to take your skill to the next level. Let’s overview the most popular CMD commands for different tasks on Windows.

Files & Folders Commands

  • assoc: Displays or modifies file extension associations

  • attrib: Displays or changes file attributes

  • comp: Compares the contents of two files or sets of files

  • compact: Displays or alters the compression of files on NTFS partitions

  • expand: Expands one or more compressed files

  • fc: Compares two files or sets of files and displays their differences

  • find: Searches for a text string in one or multiple files

  • findstr: Searches for string patterns in files

  • md: Creates a directory

  • move: Moves and renames files and directories

  • openfiles: Lists or disconnects files and folders opened on a system *you need admin access

  • print: Prints a text file

  • ren (rename): Renames one or multiple files

  • replace: Replaces files

  • robocopy: Creates robust file copy for Windows

  • tree: Graphically displays the selected folder structure of a drive or path

  • type: Displays the contents of one or more text files

  • xcopy: Copies files and directory trees

Disk & Partition Commands

  • chkdsk: Checks a disk and displays a report

  • chkntfs: Displays or modifies the checking of the disk at boot time

  • convert: Converts a FAT volume to NFTS

  • format: Formats a disk for use with Windows

  • label: Creates, changes, or deletes the volume label of a disk

  • recover: Recovers readable information from a bad or defective disk

  • vol: Displays the disk volume label and serial number, if they exist

Network Commands

  • arp: Displays and modifies the IP to physical address translation tables used by ARP (Address Resolution Protocol)

  • bitsadmin: Creates, uploads or downloads jobs and monitors their progress

  • ftp: Transfers files to and from a computer running an FTP server service

  • ftype: Displays or modifies file types used in file extension associations

  • netsh: Configures, controls, and displays network components

  • netstat: Displays protocol statistics and current TCP/IP network connections

  • route: Manipulates network routing tables

  • systeminfo: Displays OS configuration information for a local or remote machine, including service pack levels

System Information & Configuration Commands

  • driverquery: Enables you to display a list of installed device drivers *you need admin access

  • powercfg: Enables you to control power settings on a local system

  • shutdown: Turns off computer

  • time: Displays or sets the system time

  • ver: Displays the Windows version

If you want to run multiple commands, combining them instead of waiting for them to complete one after another will save you a lot of time. To combine commands, separate them with a semicolon (;) on the same line.

Moreover, you can use the ‘only if’ option. You can link the command to its predecessor. If the command follows ‘&&,’ it will complete only if the previous command is completed successfully as well. On the contrary, if the command follows ‘||,’ it will complete only if the previous command has failed.

And if this is not enough and you want to take your knowledge on related topics to the next level, visit the official Microsoft page for a list of all commands with detailed explanations in alphabetical order.

How To View Your Command Prompt Window History?

One of the main disadvantages of the Command Prompt is that it only records data from the active session. So, if you have performed commands and rebooted your computer, in theory, you will be unable to review what you have done.

Fortunately, there are a few hacks, and we’ve decided to include them as extras in our Windows command prompt cheat sheet.

First, you can use the keyboard shortcut:

  • Open a command prompt

  • Run commands

  • Press the F7 key

  • Check the list of recent commands

  • Press the one you want to execute again

  • Hit enter

Second, you can search the command history:

  • Open a command prompt

  • Execute commands

  • Press the F7 key

  • Check the list of recent orders

  • Press the F8 key

  • Type what you remember from the line

  • Press the F8 key again

  • If you don’t like the result, press the F8 key again to view another entry

Next, you can use the doskey:

  • Launch the Prompt

  • Type doskey/history

It will enable you to recall previously typed commands, edit command lines, or even create macros.

Last but not least, you can export your prompt history to file:

  • Run the CMD as an Administrator

  • Type doskey /h > c:\cmd_history.txt

  • Change the c:\cmd_history.txt to represent the file path and name you want to export your current history to

The Next Step: Windows PowerShell

PowerShell is an alternative to the Windows Command Prompt. It consists of a command-line shell, a scripting language, and a configuration management framework and is compatible with Windows, Linux, and macOS.

Question: When was PowerShell released?

Answer: Microsoft released PowerShell 1.0 in November 2006 for Windows XP SP2, Windows Server 2003 SP1, and Windows Vista.

Initially, the company released PowerShell as an optional component with many useful commands, known as cmdlets. Their goal was to integrate the cmdlets better with their offerings, for them to batch files and VB scripts.

But, just recently, the company also announced that PowerShell is replacing the CMD.EXE. Fortunately, you can still use the Command Prompt if you prefer.

Windows Command Prompt vs. Windows PowerShell

PowerShell is the more advanced and the latest version of the Command Prompt. It enables you to execute more or less the same commands as CMD. At the same time, it facilitates carrying out administrative tasks.

Let’s review a few of their differences briefly so that you can understand both applications better.

Command Prompt:

  • Works with Batch commands exclusively

  • You cannot create aliases for commands

  • You cannot pass the output from a command on to other commands

  • Output comes out in the form of text

  • No separate ISE

  • Requires an external plugin for WMI interaction

  • It doesn’t support Linux OS

  • You can only run console-type programs

  • It cannot connect to Microsoft cloud products

PowerShell:

  • Works with Batch commands and PowerShell cmdlets

  • You can create aliases for cmdlets or scripts

  • You can pass the output from a cmdlet on to other cmdlets

  • Output comes out in the form of an object

  • Has a separate ISE

  • It can integrate directly with WMI

  • Fully supports Linux OS

  • You can run all types of programs

  • It can connect to Microsoft cloud products

So, which one should you learn? It depends on your needs. PowerShell is a relatively new product. It is easy to interpret, provides more compatibility and options, and you can expect a lot of advancements promptly. On the other hand, you can perform most of the tasks using the old-school and all-timer CMD.

Conclusion

While an unpopular opinion, the CMD is, in fact, much more powerful than a GUI. Better yet, it’s not only intended for experienced or advanced users. It’s quite the contrary. The Windows prompt is equally suitable for newcomers, as it’s time-efficient and easy to use.

The bottom line is that learning about the Windows command prompt is worth it. And our Windows command prompt cheat sheet is the perfect place to start and get the most out of your Windows experience!

Bruno Mirchevski
The author
Bruno Mirchevski

Bruno Mirchevski is a seasoned hosting industry professional. With years of experience, Bruno is dedicated to helping individuals and businesses find the best web hosting solutions. As a hosting expert at HostAdvice, Bruno provides valuable insights and guidance to users seeking reliable hosting services. He also owns The Logician trademark and manages his personal brand and HE Group. His passion for the industry is reflected in his dedication to speaking at events and publishing articles and reviews on various online platforms. You can check out the most reliable and up-to-date information about web hosting directly on our blog, where Bruno shares his expertise and insights. Social profiles are available here: Twitter @brunomirchevski, LinkedIn and Quora

Frequently Asked Questions

What is the most popular file prompt command?

The cd command, copy, del, and dir commands are the most popular choices. First, the cd command allows you to change the current directory. Next, the copy command enables you to move files to another directory. The del function makes deleting files a breeze. And the dir command is used for computer files and directory listing.

What is the CMD command for Task Manager?

To open the Task Manager, simultaneously press Ctrl+Shift+Escape on your computer keyboard.

What is the System File Checker command?

The System System File Checker is a file explorer. For example, it enables you to detect and restore corrupted Windows system files on your Windows PC, making sfc/scannow a very useful command.

Why is the cipher command so popular?

You can use it for encryption/decryption of data on drives that use the NFTS file system or view files' and folder's encryption status. Clients mostly love it as it adds to security.