diskpart: Managing Drives and Partitions from Command Prompt

Advanced Command Prompt Fixes Applies to: Windows 7, Windows 10, Windows 11

A powerful tool for viewing and managing disks and partitions — and one where mistakes can genuinely erase data, so read carefully.

Before you start: save any open work and note down what you were doing when the problem started — that context helps if you need to search further or ask for help.
  1. Type diskpart in an administrator Command Prompt to enter its own separate command environment — you'll notice the prompt changes to "DISKPART>".
  2. Type list disk to see every physical drive connected to your PC, each with a number — take real care to identify the correct one before doing anything else.
  3. Type select disk 1 (using the correct number from the list) to select a specific drive, then list partition to see its partitions.
  4. Commands like clean, format, and delete partition are genuinely destructive and will erase data with no confirmation prompt and no undo — never run them unless you're completely certain which disk number is selected.
  5. For routine tasks like checking drive status or extending a partition into unallocated space, diskpart is safe and useful — the danger is specifically in the deletion and formatting commands, not the tool itself.
Still not fixed? Send us the details and we'll help you dig further, or browse related guides in Command Prompt Fixes.

Frequently Asked Questions

Is diskpart riskier than other command-line tools?
Yes, meaningfully — diskpart can permanently delete partitions and data with commands like "clean," and it doesn't always ask for confirmation the way a graphical tool would. Double-check which disk you've selected before running any destructive command.
Do I need diskpart for everyday tasks, or just special situations?
Just special situations — Disk Management (the graphical tool) handles routine tasks like resizing or formatting a partition fine. diskpart is for scenarios Disk Management can't handle, or when you need to script the process.

Related guides