Manage your PC`s drives: disks, partitions, volumes, or virtual hard disks

Microsoft DiskPart

Microsoft DiskPart

  -  204.8 KB  -  Freeware
  • Latest Version

    Microsoft DiskPart 5.1.3553 LATEST

  • Review by

    Michael Reynolds

  • Operating System

    Windows XP / Vista / Windows 7 / Windows 8 / Windows 10

  • User Rating

    Click to vote
  • Author / Product

    Microsoft Corporation / External Link

  • Filename

    diskpart_setup.exe

Microsoft DiskPart is a command-line disk partitioning utility that comes pre-installed with Windows operating systems. It is a powerful tool designed for advanced users and IT professionals to manage disk partitions with a higher degree of control and flexibility than the graphical Disk Management tool.

It allows users to create, delete, resize, and format partitions, as well as assign or remove drive letters.

DiskPart commands help you to manage your PC's drives (disks, partitions, volumes, or virtual hard disks). Before you can use DiskPart commands, you must first list, and then select an object to give it focus. When an object has to focus, any DiskPart commands that you type will act on that object.

You can list the available objects and determine an object's number or drive letter by using the list disk, list volume, list partition, and list vdisk commands.

The list disk, list vdisk, and list volume commands display all disks and volumes on the computer. However, the list partition command only displays partitions on the disk that has focus. When you use the list commands, an asterisk (*) appears next to the object with focus.

When you select an object, the focus remains on that object until you select a different object. For example, if the focus is set on disk 0 and you select volume 8 on disk 2, the focus shifts from disk 0 to disk 2, volume 8. Some commands automatically change the focus. For example, when you create a new partition, the focus automatically switches to the new partition.

You can only give focus to a partition on the selected disk. When a partition has focus, the related volume (if any) also has focus. When a volume has focus, the related disk and partition also have focus if the volume maps to a single specific partition. If this is not the case, focus on the disk and partition is lost.

Key Features

Comprehensive Disk Management
It offers a wide range of disk management capabilities including creating, deleting, formatting, and resizing partitions. It supports both MBR (Master Boot Record) and GPT (GUID Partition Table) partition styles.

Advanced Volume Management
Users can extend or shrink volumes, mark partitions as active, and assign or remove drive letters. This level of control is beneficial for configuring systems, preparing disks for new installations, or managing large storage environments.

Scriptable Commands
It allows for scripting, which enables the automation of complex or repetitive tasks. Users can write scripts to perform multiple disk operations in sequence, saving time and reducing the risk of errors.

Integration with Windows PE
The tool is often used in conjunction with Windows Preinstallation Environment (Windows PE) for tasks such as preparing drives for Windows installation, recovering data, or deploying disk images.

Command-Line Interface
The command-line interface of the app provides more precision and control compared to graphical tools. Advanced users can perform tasks more efficiently through direct command input.

You can run the following commands in the Microsoft Diskpart command interpreter:
  • Active
  • Add
  • Assign
  • Attach vdisk
  • Attributes
  • Automount
  • Break
  • Clean
  • Compact vdisk
  • Convert
  • Create
  • Delete
  • Detach vdisk
  • Detail
  • Exit
  • Expand vdisk
  • Extend
  • Filesystems
  • Format
  • GPT
  • Help
  • Import
  • Inactive
  • List
  • Merge vdisk
  • Offline
  • Online
  • Recover
  • Rem
  • Remove
  • Repair
  • Rescan
  • Retain
  • San
  • Select
  • Set id
  • Shrink
  • Uniqueid
User Interface

DiskPart is a command-line utility, meaning it does not have a graphical user interface (GUI). Instead, users interact with the software through the Command Prompt or PowerShell.

The interface consists of text-based commands that users must type to perform various disk management tasks.

Command-Line Structure

The command-line structure requires familiarity with specific commands and syntax. Each command is entered sequentially, often starting with diskpart to launch the utility, followed by commands like list disk, select disk, and create partition to perform specific actions.

Installation and Setup

This tool is included by default in Windows operating systems, so there is no need for a separate installation. It is accessible from the Command Prompt or PowerShell.

Here’s how to start DiskPart:
  • Press Win + R to open the Run dialog.
  • Type cmd or powershell and press Enter to open the Command Prompt or PowerShell.
  • Type diskpart and press Enter to launch the app.
  • Upon launching, you will see the DISKPART> prompt indicating that the utility is ready for input.
FAQ

What is DiskPart used for?
This program is used for managing disk partitions on Windows operating systems. It allows users to create, delete, resize, and format partitions, as well as assign or remove drive letters.

Can DiskPart recover deleted partitions?
The tool itself does not have a specific command to recover deleted partitions. However, it can assist in preparing disks for data recovery software by marking partitions and setting attributes.

How do I exit DiskPart?
To exit DiskPart, simply type exit at the DISKPART> prompt and press Enter. This will return you to the Command Prompt or PowerShell.

Is DiskPart safe to use?
DiskPart is a powerful tool that should be used with caution. Incorrect commands can result in data loss or system instability. It is recommended for advanced users who understand disk management concepts.

Can I use DiskPart on external drives?
Yes, it can be used to manage partitions on both internal and external drives. Ensure that you select the correct disk to avoid affecting the wrong drive.

Alternatives

EaseUS Partition Master - A popular choice with a comprehensive set of disk management features, including partition resizing, cloning, and recovery. It offers both free and paid versions.

MiniTool Partition Wizard - Another powerful tool with a user-friendly GUI. It provides features such as partition alignment, conversion between MBR and GPT, and data recovery.

AOMEI Partition Assistant - Known for its ease of use and wide range of features. It includes disk cloning, migration to SSD, and partition recovery.

System Requirements
  • Windows 11, 10, 8 or 7
  • Both 32-bit and 64-bit architectures
  • No additional hardware or software is needed to use this tool.
PROS
  • Powerful and Flexible: Offers comprehensive disk management capabilities.
  • Free: Included with Windows operating systems at no extra cost.
  • Scriptable: Supports automation through scripting.
  • Integration: Works well with Windows PE for advanced tasks.
CONS
  • Complexity: Requires knowledge of command-line operations.
  • Risk: Incorrect commands can lead to data loss.
  • No GUI: Lack of a graphical interface may be challenging for some users.
Conclusion

Microsoft DiskPart is a powerful disk partitioning tool that provides advanced users and IT professionals with a high degree of control over disk management tasks. Its comprehensive feature set, scriptability, and integration with Windows PE make it an invaluable tool for managing storage in a Windows environment.

However, its command-line interface and potential risk of data loss require users to have a solid understanding of disk management principles. For those comfortable with command-line operations, it offers unmatched flexibility and functionality.

For users seeking a more user-friendly experience, there are several alternative partition management tools with graphical interfaces that may be better suited to their needs.

Note: Membership in the local Administrators group, or equivalent, is the minimum required to run Disk Part. Applies To: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, and Windows Server 2008 R2, Windows Server 2008.

  • Microsoft DiskPart 5.1.3553 Screenshots

    The images below have been resized. Click on them to view the screenshots in full size.

    Microsoft DiskPart 5.1.3553 Screenshot 1