How to Use Diskpart to Clean a Drive in Windows 11

The Diskpart command-line utility in Windows 11 allows users to completely clean or securely wipe internal hard drives, SSDs, and external storage devices. This guide provides a straightforward walkthrough on launching Diskpart, selecting the correct storage drive, and executing either a standard clean to remove partition configurations or a full wipe to permanently erase all data.

Step 1: Open Command Prompt as Administrator

  1. Press the Windows Key + S and type cmd.
  2. Right-click Command Prompt in the search results and select Run as administrator.
  3. Click Yes if prompted by User Account Control (UAC).

Step 2: Launch the Diskpart Utility

In the Command Prompt window, type the following command and press Enter:

diskpart

Step 3: Identify and Select the Target Disk

  1. List all drives currently connected to the computer by typing:

    list disk
  2. Identify the disk number corresponding to the drive you want to erase (e.g., Disk 0, Disk 1).

  3. Select the target disk by running:

    select disk #

    (Replace # with your specific disk number, for example: select disk 1).

Step 4: Choose a Cleaning Method

Option A: Standard Clean (Fast)

This command deletes all partition tables, formatting, and volume signatures, making the drive appear unallocated. The underlying data remains recoverable using recovery tools.

clean

Option B: Full Wipe / Clean All (Secure)

This command writes zeros to every sector of the drive. It completely overwrites all data, making recovery impossible, and takes longer depending on the drive size.

clean all

Step 5: Initialize and Format the Cleaned Drive (Optional)

To make the drive usable again immediately, run the following commands sequentially:

  1. Create a primary partition:

    create partition primary
  2. Format the partition using NTFS (or fs=exfat for cross-platform use):

    format fs=ntfs quick
  3. Assign a drive letter:

    assign

Step 6: Exit Diskpart

Type the following command and press Enter to close the Diskpart tool:

exit

Close the Command Prompt window. The drive is now clean, formatted, and ready for use.