Formatting the C: drive wipes your Windows operating system and all files on it, returning the drive to a blank state. This guide shows you how to do it using the Command Prompt, which is necessary because Windows will not let you format the drive it is running from while the OS is active. You will need a Windows installation USB or recovery drive to boot into the recovery environment, and you must back up any files you want to keep before starting.
What You’ll Need
- A Windows installation USB drive or a system repair disc (created on another PC).
- Access to another computer to create the bootable media if you don’t have one.
- A backup of all important files from the C: drive—this process is irreversible.
- Your Windows product key (optional, but needed for reinstallation).
Step-by-Step
- Back up your data. Copy everything you need to an external drive, cloud storage, or another computer. Formatting erases everything on C: permanently.
- Create a Windows installation USB. On another PC, download the Windows Media Creation Tool from Microsoft’s official website. Run it, choose “Create installation media,” select your language and edition, and pick USB flash drive. Insert a blank 8GB+ USB and follow the prompts.
- Boot from the USB. Insert the USB into the PC you want to format, restart it, and press the boot menu key (usually F12, F10, Esc, or Del) during startup. Select the USB drive from the list. If it doesn’t appear, you may need to change the boot order in BIOS/UEFI settings.
- Start the Windows Setup. When the Windows logo appears, choose your language and click “Next.” Then click “Repair your computer” in the bottom-left corner instead of “Install now.”
- Open Command Prompt. In the recovery environment, go to Troubleshoot → Advanced options → Command Prompt. A black terminal window will open.
- Identify the correct disk. Type
diskpartand press Enter. Then typelist diskand press Enter. Note the disk number that corresponds to your C: drive (usually Disk 0, but verify by size—your C: drive is typically the largest). - Select the disk. Type
select disk X(replace X with the disk number) and press Enter. Be absolutely certain you have the right disk—this will wipe everything on it. - Clean the disk. Type
cleanand press Enter. This removes all partitions and data from the selected disk. This is the point of no return. - Create a new partition. Type
create partition primaryand press Enter. - Format the partition. Type
format fs=ntfs quickand press Enter. This formats the new partition as NTFS (the standard Windows file system). - Assign a drive letter. Type
assign letter=Cand press Enter. This makes the new partition accessible as C:. - Exit DiskPart. Type
exitand press Enter, then typeexitagain to close Command Prompt. - Reinstall Windows (or close the window). If you want a working system, close the recovery window and click “Install now” in the setup screen to reinstall Windows. If you only wanted to wipe the drive, you can shut down the PC now.
Common Mistakes
- Selecting the wrong disk. The
cleancommand wipes the entire disk, not just one partition. Double-check the disk number and size before proceeding. - Skipping the backup. Many users forget to back up files, then lose years of photos and documents. Always back up before formatting.
- Using the wrong format type. For Windows, use NTFS. If you plan to install Linux alongside, you might want exFAT, but for standard Windows use NTFS.
- Not booting from the USB. If you try to format C: from within Windows, you’ll get an error because the system drive is in use. You must boot from external media.
- Forgetting to create a new partition. After
clean, the disk has no partitions. If you skip thecreate partitionstep, the format will fail or the drive won’t appear in Windows.
Tips
- Use the quick format. The
quickoption is much faster and sufficient for most cases. A full format checks for bad sectors but takes much longer. - Verify the disk before cleaning. Run
list diskand note the size. If your C: drive is 500GB, the disk should show ~465GB (due to binary vs decimal). If you see a 1TB disk, that’s not your C:. - Keep the USB handy. After formatting, you’ll need the USB to reinstall Windows. Don’t remove it until the installation is complete.
- Write down your product key. If you don’t have a digital license linked to your Microsoft account, you’ll need the 25-character key to activate Windows after reinstall.
- Consider a clean install instead. If you want to reinstall Windows, you can skip the manual formatting and let the Windows Setup format the drive during installation. This guide is for when you specifically want to use Command Prompt.
Troubleshooting
- “The disk is in use” error. This happens if you run DiskPart from within Windows. You must boot from the USB and use the recovery Command Prompt.
- USB not booting. Check BIOS/UEFI settings: disable Secure Boot temporarily, enable Legacy/CSM mode if your USB is not UEFI-bootable, or try a different USB port (preferably USB 2.0).
- “No disk selected” after clean. Run
select disk Xagain, thenclean. Make sure you type the disk number correctly. - Format fails with “Access denied.” This usually means you haven’t selected the right partition or the disk is still in use. Run
list diskandselect diskagain, thencleanand re-create the partition. - After formatting, Windows won’t boot. That’s expected—you erased the OS. You need to reinstall Windows from the USB. If you don’t have the USB, create one on another PC.
- DiskPart doesn’t recognize the drive. Check that the drive is properly connected (SATA cable, power). In rare cases, the drive may be failing; try a different cable or port.
Frequently Asked Questions
Can I format the C: drive while Windows is running?
No. Windows locks the system drive to prevent accidental deletion. You must boot from external media like a USB or recovery disc.
Will formatting C: delete my other drives (D:, E:)?
Only if they are on the same physical disk and you select that disk in DiskPart. If D: is a separate hard drive, it will be untouched.
How long does formatting take?
With the quick option, it takes seconds to a minute. A full format can take hours depending on the drive size and speed.
Do I need a product key to format?
No, formatting doesn’t require a key. You only need it when reinstalling Windows to activate it.
Can I use the same Command Prompt steps to format an external drive?
Yes, but you can also do it from within Windows using Disk Management or Command Prompt as administrator. The steps are the same, but you don’t need to boot from a USB for non-system drives.
What if I accidentally format the wrong drive?
There is no undo. Stop using the drive immediately and try data recovery software. Professional recovery services may help, but success is not guaranteed.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- How to Enable Privacy Indicators on Chromebook
- How to Calculate Taxes on Overtime Pay
- VPN Not Working on iPhone? Fixes That Actually Work
- Hide & Unhide Apps on Samsung Phones
- Fix DNS Server Unavailable Error in Windows 11
- Fix iOS 17 Keyboard Not Working Properly