Want to use disk management with CMD like a professional? Let’s discover quick shortcut, powerful DiskPart commands, and expert tips.
Disk Management CMD
Managing disks and partitions efficiently is crucial for optimizing our Windows system’s performance. While the Disk Management tool provides a graphical interface, sometimes using the Command Prompt is faster or necessary, especially when troubleshooting or automating tasks.

In this guide, we have cover how to open Disk Manager using the Command Prompt, how to use DiskPart commands for advanced disk management, and how to check your Windows version before performing disk operations.
How to Run Disk Manager from Command Prompt
There are two primary ways to access Disk Management via Command Prompt:
1. Using diskmgmt.msc
(Graphical Interface)
If we prefer a graphical interface but want a quick shortcut, we can use the diskmgmt.msc
command to launch the Disk Management tool directly from the Command Prompt.
Steps to Open Disk Management
Open Command Prompt as an administrator by searching for cmd in the Start menu, right-clicking it, and selecting Run as administrator.
Type the following command and press Enter:
diskmgmt.msc
The Disk Management window will open instantly, allowing us to manage partitions, assign drive letters, format disks, and more.
Shortcut Tip: We can also use the Power User Menu by pressing WIN + X and selecting Disk Management for an even quicker way to open the tool.
2. Using diskpart
(Command-Line Utility)
For those who prefer command-line control, the diskpart
utility provides a powerful way to manage disks, partitions, and volumes without a GUI. This tool is particularly useful for automation, remote management, or when the graphical interface isn’t working.
Steps to Open DiskPart
Open Command Prompt as an administrator and type the following command, then press Enter:
diskpart
The prompt will change to DISKPART>, indicating that we are now inside the DiskPart utility.
DiskPart Commands for Disk Management
Once inside DiskPart, we can use the following commands to list, create, modify, and delete partitions.
Basic Disk Management Commands
List all available disks:
list disk
This command displays all connected storage devices, including internal hard drives, SSDs, and external drives. Each disk is assigned a number (e.g., Disk 0
, Disk 1
).
Select a specific disk (replace n
with the disk number):
select disk n
This command selects a disk for further operations. Necessary before creating, formatting, or deleting partitions.
View partitions on the selected disk:
list partition
Displays all partitions on the currently selected disk, showing partition sizes, types (primary, extended, logical), and status.
Select a specific partition (replace n
with the partition number):
select partition n
Selects a partition for further operations like formatting or assigning drive letters.
Creating and Formatting Partitions
Create a primary partition (replace <MB>
with the size in megabytes):
create partition primary size=<MB>
Creates a new primary partition of the specified size. If no size is specified, the partition uses all available unallocated space.
Format the selected partition (replace <filesystem>
with NTFS, FAT32, or exFAT):
format fs=<filesystem> label=<label> quick
Formats the selected partition with the chosen file system. The quick
option speeds up formatting by skipping bad sector checks.
Assign a drive letter (replace <driveletter>
with a letter, e.g., D):
assign letter=<driveletter>
Assigns a letter to the selected partition, making it accessible in File Explorer.
Mark the partition as active (used for bootable drives):
active
Marks the partition as bootable, essential when setting up a system disk.
Modifying and Deleting Partitions
Change a drive letter (replace <new>
with the new letter):
assign letter=<new>
Changes the drive letter of an existing partition.
Remove the assigned drive letter:
remove letter=<driveletter>
Unassigns a drive letter, making the partition invisible in File Explorer.
Delete the selected partition:
delete partition
Deletes the selected partition, making the space unallocated.
WARNING: This permanently erases data.
Delete all partitions on the selected disk (WARNING: This will erase everything!):
clean
Erases all partitions and volumes from the selected disk. Useful for reinitializing a disk before reformatting.
Converting Disk Types
Convert an MBR disk to GPT (WARNING: This deletes all data!):
convert gpt
Converts the selected disk to GPT (GUID Partition Table), necessary for UEFI boot mode.
Convert a GPT disk to MBR (WARNING: This deletes all data!):
convert mbr
Converts the selected disk to MBR (Master Boot Record), commonly used in legacy BIOS systems.
Checking and Repairing Disks
Check a disk for errors and fix them:
chkdsk C: /f /r
Scans the disk for file system errors and bad sectors, then repairs them.
Check the file system of a partition:
fsutil fsinfo volumeinfo C:
Displays detailed information about the selected partition’s file system.
Scan the disk for corruption and repair it:
sfc /scannow
Runs the System File Checker (SFC) tool to fix corrupted system files.
Be Careful with DiskPart: Many diskpart
commands permanently delete data or modify partitions. Always double-check before executing commands.
How to Check Your Windows Version
Before performing disk management tasks, it’s important to verify our Windows version to ensure compatibility with certain commands.
Method 1: Using winver
Open Command Prompt and type the following command, then press Enter:
winver
A pop-up window will display the Windows version and build number.
Method 2: Using systeminfo
For a more detailed text-based output, use this command:
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
This method provides additional details such as the exact Windows version and system architecture.
Conclusion: Using Disk Management with CMD
Running Disk Manager from the Command Prompt gives us greater flexibility and control over disk operations. Whether we use diskmgmt.msc
for a graphical interface or diskpart
for advanced command-line management, knowing these tools helps us handle storage tasks efficiently.
Before making major changes, always double-check our Windows version and back up important data to prevent accidental loss. By mastering both GUI and command-line disk management, we can confidently manage storage devices like a pro.
Check out our latest posts on the Blog Page!
I’m Vanshika Vampire, the Admin and Author of Izoate Tech, where I break down complex tech trends into actionable insights. With expertise in Artificial Intelligence, Cloud Computing, Digital Entrepreneurship, and emerging technologies, I help readers stay ahead in the digital revolution. My content is designed to inform, empower, and inspire innovation. Stay connected for expert strategies, industry updates, and cutting-edge tech insights.