Using the DiskPart Utility

Written by Barry Dysert (last updated July 22, 2019)

DiskPart is a command-line utility that lets you manage disk-related objects like drives, virtual disks, partitions, and volumes. You invoke DiskPart by typing DiskPart at a command prompt and pressing Enter. (You must be in the Administrators group to run DiskPart.) DiskPart accepts 38 different commands, which can be listed by typing Help at the DiskPart prompt.

While the Help command lists the available commands in alphabetical order, logically, the DiskPart commands can be grouped into the following categories:

  • Commands to set focus: Select
  • Commands to display disk configuration: Detail, List
  • Commands to manage basic disks: Active, Assign, Create, Delete, Extend, Remove
  • Commands to manage dynamic disks: Active, Add, Assign, Break, Create, Delete, Extend, Import, Online, Remove, Retain
  • Commands to convert disks: Convert
  • Miscellaneous commands: Clean, Exit, Help, Rescan

DiskPart operates on whatever object currently has focus. You can assign focus to an object through the Select command, e.g.,

DISKPART> Select Disk 0

Subsequent commands will now operate on Disk 0 until focus is assigned to another object.

You leave the DiskPart utility by typing Exit at the DiskPart prompt.

 This tip (12662) applies to Windows 7, 8, and 10.

Author Bio

Barry Dysert

Barry has been a computer professional for over 35 years, working in different positions such as technical team leader, project manager, and software developer. He is currently a software engineer with an emphasis on developing custom applications under Microsoft Windows. When not working with Windows or writing Tips, Barry is an amateur writer. His first non-fiction book is titled "A Chronological Commentary of Revelation." ...

MORE FROM BARRY

Understanding DHCP

DHCP allows computers to join IP-governed networks without the need for system administrators to set up configuration ...

Discover More

Understanding Windows Update

It is important to keep your system updated with the latest software patches. This keeps your computer safer from attacks ...

Discover More

Using Flip 3D

Flip 3D is an Aero feature that allows you to cycle through your active windows in three dimensions. Because they are ...

Discover More
More WindowsTips

Using Offline Files

If you need access to files on a network but aren't always on the network, you may find that the offline files feature of ...

Discover More

Creating a Bootable USB Flash Drive

If your hard disk becomes problematic to the point where you can't even boot from it, you'll be glad you have a bootable ...

Discover More

Pin Items to File Explorer's Quick Access View

You can improve your efficiency at navigating the file system by using the Quick Access view. This tip shows you how to ...

Discover More
Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 6?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


Newest Tips