Updated By

Linda

Written By

Tracy King

Last Updated on April 22, 2024

You may have heard of the Command Prompt and have a basic understanding of what it does. But when it comes to managing disk partitions, fixing some disk errors, or running certain diagnostic tests, do you know how to open the Command Prompt and which commands to use for these tasks?

And that's okay, even if you don't know much about it. On this page, we'll provide a beginner's guide to Command Prompt to help you teach yourself. Let's get started:

Please provide the English content you want translated, and I'll do my best to translate it into Chinese.

In this article, you will learn:
  • What is Command Prompt
  • How to Open Command Prompt in Windows 11/10 or Older Versions
  • The Most Important Commands in Command Prompt
  • How to Master Command Prompt in Windows 11/10 for Disk Management
  • How to Manage Files in Windows with Command Prompt Commands

Note: This page is intended for Windows beginners. If you encounter errors when running Windows Command Prompt commands, be sure to type the commands exactly as shown on this page.

Let's see how you can teach yourself to use the Command Prompt on your Windows computer like a pro.

What is Command Prompt?

Thus, the "Command Prompt" is an interpreter application that commands most Windows operating systems to perform various tasks through multiple command-line instructions. The Command Prompt is referred to as the Windows Command Processor, but it's more commonly known as the Command Shell or CMD prompt. It's also fondly referred to as cmd.exe. Occasionally, it's called MS-DOS or simply the "DOS prompt."

Command Prompt window

Command Prompt is widely used by many Windows system administrators and IT professionals, but it's not very popular among Windows beginners. That's because Command Prompt has over 280 commands, each designed to solve a different problem. With so many complex commands to learn, most new Windows users prefer to use alternative tools instead.

Is the Command Prompt accessible to Windows novices, and can it be used to address basic issues with your Windows computer, hard drive, or even external storage devices? Absolutely – let's take a look at how to get started with Command Prompt on your PC.

How to Open Command Prompt in Windows 11/10 or Older Versions

There are several ways to open the Command Prompt on a Windows computer. Here, we'll show you five standard methods to quickly launch and open the Command Prompt window on your machine. Let's get started:

#1. Press Windows + X to open the Command Prompt.

Press Windows + X and select or click "Command Prompt (Admin)" to open Command Prompt as an administrator in Windows 11/10/8.1/8.

Open Command Prompt with hotkey

#2. Open the Command Prompt from the Windows or Start menu

Click the Windows logo or Start button, scroll down, and select Command Prompt from the list, then click Command Prompt to open it.

This method works for opening Command Prompt in Windows 10/8.1/8 and earlier.

Open Command Prompt from the Start menu:

#3. Open Command Prompt via Search Box

Press the Windows + S keys to open the Search box, type cmd or Command Prompt, and then right-click Command Prompt from the results.

Right-click Command Prompt and select Run as administrator. This will open the Command Prompt on Windows 11, 10, 8.1, 8, or 7.

Open Command Prompt via search box

#4. Open Command Prompt from the Run Dialog Box

Press Windows + R, type `cmd` into the dialog box that appears, then click "OK". This will open the Command Prompt in all versions of Windows.

Open Command Prompt from Run Dialog

#5. Open Command Prompt from Task Manager

Press Ctrl + Alt + Del, and click “Task Manager.” Click “File,” then select “New Task.” Wait for the Run dialog box to appear, type cmd, then click “OK.” This will open the Command Prompt window on your computer.

Open Command Prompt through Task Manager

In addition to the five methods above, there are many other workarounds that can help you quickly open and access the Command Prompt on your Windows PC. For more detailed information, refer to:

Related Articles

10 Ways to Quickly Open Command Prompt in Windows 10

How to open Command Prompt in Windows 10? You just need to find the right way. Windows 10 offers almost 10 ways to access Command Prompt. Let's take a quick look.

How to Open Command Prompt

The Most Important Command Prompt Commands

As mentioned, Microsoft added more than 280 commands for administrators and developers to run and execute multiple tasks on Windows machines from the command prompt.

But most new Windows users would find that list overwhelming, and few could be expected to remember so many command-line options.

Here, we have gathered the most important and widely used Command Prompt commands that regular users can make use of:

Type Command
Manage Hard Disk Partitions
  • CHKDSK: Check and fix file system errors
  • Format: Quickly format partition and change file system
  • Convert: Change disk type to MBR or GPT
  • Clean/Clean All: Wipe the entire disk
  • Create: Create primary or logical partition
Manage Files
  • Del: Delete files in partition
  • Copy: Copy files between local drives
  • Attrib: Display hidden files

In addition to these three main types of command prompts, there are many other varieties. You can refer to the Windows Command reference for a full list of commands.

How to Master Command Prompt for Disk Management in Windows 11/10

So, how can a beginner get started with Command Prompt in Windows 11/10 or even older versions? Follow this comprehensive guide to learn how to use it to fix numerous issues on your computer. Let's begin.

When your hard drive or storage device encounters different errors, you need to run different command lines to fix them. Here's how to use them on your computer:

#1. Run CHKDSK from the Command Prompt - Check and Fix Disk File System Errors

CHKDSK is a command used to check and fix disk errors on a Windows PC, such as an external hard drive.

    Open Command Prompt using any of the methods above, but run it as an administrator. In Command Prompt, type the following command to check and fix file system errors on your internal or external hard drive: `chkdsk E: /f /r /x`.

Please replace E: with the drive letter of your hard disk partition.

Run CHKDSK in Command Prompt

#2. Run the formatting command in Command Prompt - Format or change the file system of the device

The format command can help you change the file system to FAT32, NTFS, or even exFAT. Sometimes, you can also use it to fix a Raw drive or other unknown errors on a storage device, like formatting a USB with CMD< a href="/partition-master/format-usb-flash-drive-using-cmd.html" target="_blank">.

    • Launch the Command Prompt as an administrator with the five permissions listed above.
    • Type the command below to format the target hard drive partition:
    1. diskpart
    1. list disk
    1. select disk # (Replace # with the number of your USB drive)
    1. list volume
    1. select volume # (Replace # with the volume number of your USB flash drive)
    1. format fs=ntfs quick (Alternatively, you can replace NTFS with FAT32 or exFAT)
    1. exit

Format hard drive in Command Prompt

#3. Run the Conversion Command in Command Prompt - Change Disk Type to MBR/GPT

If you want to convert a disk to MBR or GPT via CMD, remember to back up all files on the target disk. This is because converting a disk via Command Prompt requires deleting all existing partitions, leading to data loss.

You might also be interested in:

Related Articles

How to Convert Disk to MBR or GPT

If you prefer a safer way, you can rely on the Partition Master tool and its disk conversion function. It supports converting a disk to MBR or GPT without losing any data.

convert disk to mbr or gpt

Here's how to convert a disk using the Command Prompt:

    1. Open Command Prompt as an administrator.
    2. Type in the command to convert your disk:
    • diskpart
    • select disk *
    • clean
    • convert mbr (or convert gpt)

Convert disk to GPT in Command Prompt

#4. Run Clean/Clean All from the Command Prompt - Clean or wipe a hard drive

When you need to quickly and effectively sanitize or wipe a hard drive, you can use the "Clean" or "Clean All" command for this purpose. Please note that the "Clean" command will format and delete all existing partitions on the drive, while the "Clean All" command will completely erase everything from the disk.

Make sure you know the right command to use for your disk, whether it's an HDD, SSD, or even an external device. Here's how:

    Open the Command Prompt on your computer and run it as an administrator. Enter the following commands, pressing Enter after each one:
    • diskpart
    • list disk
    • select disk *
    • clean, or clean all
    • exit
    Note: * represents the disk number, which should be replaced with a specific disk number when used in practice.

Erase disk with Clean all command in Command Prompt

Step 5: Create the primary/logical partitions using the Create command in the Command Prompt

When you partition a new hard drive, you can use the create command in Command Prompt to create a primary partition or logical drive on the disk. Here are the steps:

    1. Open the Command Prompt as an administrator in Windows.
    2. Type each of the following commands one at a time, pressing Enter after each:
    • **list disk** • **select disk * **(Replace * with the disk you want to choose.) • **list partition** • **create partition primary size=1024**(1024 MB equals 1 GB.)(You can also use the commands "**create partition extended size=***" and "**create partition logical =***" instead of this command.) • **assign letter=*** • **exit**

Create partition in Command Prompt

Extra Tip: Manage and Partition Windows Disks with the Command Prompt Utility Partition Master

As mentioned, different command lines are needed to execute and fix various issues, making the command prompt a bit complicated, right? Here comes a reliable alternative – professional disk management software – AOMEI Partition Assistant, which can help you partition, manage, and optimize disk partitions with ease like an expert.

Step 1. Launch AOMEI Partition Assistant, and check the available space of the disk in "Partition Management".

    • If you have unallocated space on your hard disk, skip to step 3 to create the partition. • If you do not have any unallocated space, proceed to step 2.

Step 2: Shrink the disk partition to create unallocated space.

Right-click on the target partition with lots of free space, and select “Resize/Move.”

Step 1 to Shrink Partition

Then, drag either end of the partition to the left or right to shrink it and free up enough unallocated space. You can see how much you've reduced the size by in the “Size” field. Click “OK.”

Step 2 of Reducing Partitions

Click “Perform XX Task” and then “Apply” to save all the changes.

Resize Partitions Step 3

Back in the “Disk Management” tool, you should see the unallocated space on the same disk, and you can proceed to create a new partition on your hard drive.

Step 3. Create a new partition on the target drive using the unallocated space.

Right-click the unallocated space, and then select New.

Create partition step 1

Customize the partition size, drive letter, label, and file system (NTFS, FAT32, EXT2/3/4, exFAT) in the "Advanced Settings." Click "OK."

Create partition step 2

Finally, click “Execute tasks” and “Apply” to create the partition using the unallocated space on your disk. Repeat these steps to partition your hard drive and create more partitions.

Create Partition Step 3 Create Partition Step 3

How to Manage Files in Windows Using Command Prompt Commands

In addition to using partition commands at the command prompt, some power users might run commands to manage files and fix file issues on a device.

Here we will go over how to run commands in the Command Prompt on Windows to manage your files.

#1. Run Del in Command Prompt to delete a file

Please note that the `DEL` command is designed to permanently delete files or content from a drive or device without going through the Recycle Bin. Therefore, make sure you select the correct device to run the command, as accidentally losing important files cannot be undone.

    Open Command Prompt as an administrator. Enter one of the following command lines to delete unnecessary files or folders from the drive:
    • del /s C:\Users\Tim\Documents\Adobe\*.* (Replace C:\Users\Tim\Documents\Adobe\*.* with any subfolder on your computer's drive.)
    • del C:\User\Tim\Downloads\*.exe (Replace C:\User\Tim\Downloads\ with a different path and replace *.exe with another file extension to delete files of a different format from a different drive.)

You might also be interested in:

Related Articles

How to Permanently Delete Files from Computer Without Recovery

Follow this guide to learn how to permanently delete files and protect your data on your PC or laptop, whether you're dealing with the computer, external hard drive, or USB flash drive.

Permanently Delete Files Without Recovery

## 2. Copying and Moving Files Between Local Drives

In addition to deleting files or folders, Command Prompt also lets you copy or move files from one drive to another locally in Windows. You can learn how to use Command Prompt to copy files here:

    1. Open Command Prompt as an administrator.
    2. Type one of the following commands, and then press Enter to perform the file copy operation:
  1. copy c:\*.txt e: - This will copy all .txt files from the C: drive to the E: drive.

(You can replace ** with the name of a specific file, or replace .txt with another file extension to copy other types of files, such as .xls. Or you could replace c: or e: with a different drive letter.)

    • XCOPY C:\test D:\test /E /H /C /I – This will copy all files from the C: drive to the D: drive.

(C: and D: can be replaced with other drive letters.)

Syntactic meaning:

    • /E — Copies all subdirectories, including empty ones.
    • /H — Copies hidden files and files with system attributes.
    • /C — Continues copying even if errors occur.
    • /I — Assumes that the destination is a folder if there's any doubt.

You might also be interested in:

Related Articles

How to Move Large Files from One Drive to Another

You can try copying and pasting at a basic level, but it may fail if the file you're transferring is huge. Thus, we highly recommend the simplest way – using the Todo PCTrans tool to move large files from one drive to another.

Move Large Files from One Drive to Another

#3. Run the Attrib Command in Command Prompt – Show Hidden or Missing Files

When your files go missing or get hidden on a storage device, you can use this tool for assistance:

    Open the Command Prompt as an administrator in Windows. Enter the following commands, pressing Enter after each one to check and uncover hidden files:
  1. Check the disk E:\f
  2. Confirm (Y)
  3. Select the disk E
  4. Clear the hidden, read-only, and system attributes of all files in drive E

(E: should be replaced with the drive letter of your device. This command will help repair errors on the device and find any lost or missing files on the storage device.)

You might also be interested in:

Related Articles

How to Show Hidden Files via CMD, Control Panel, and Software

When your files go missing from USB drives or hard drive, you may wonder, "Is there a command in Windows Command Prompt that can list hidden files?" Yes, there's a command to show hidden files.

Picture of Showing Hidden Files

"The Command Prompt has powerful disk and file management capabilities, so use it with care."

On this page, we explain what Command Prompt is, how to open it in Windows, and what you can do with its most important command-line utilities. We've also included detailed steps on how to run these commands to resolve and fix various issues.

While performing tasks through the command line can be powerful and efficient, there is also a danger involved if you type in a wrong command. So, be very careful when running commands.

If you're looking for a tool that can completely replace the command prompt for disk management, try Partition Master.

Alternatively, if Command Prompt isn't working on your PC, use its alternative utility to perform the task at hand. Afterward, try fixing it by enabling CMD or performing a system restore to return the Command Prompt to its original state. You can refer to the step-by-step guide in Command Prompt not working in Windows 11/10 for assistance.