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

Removing a Place from the Recent Places or Quick Access Lists

Some Windows features can be both time savers and privacy concerns at the same time. The Recent Places list and the Quick ...

Discover More

Transferring Pictures from a Memory Card

Transferring pictures from a memory card to your computer may be simpler than you think. This tip describes the process.

Discover More

Adding and Deleting Fonts

Sometimes a document you're working on needs a font different from what comes with Windows. In such a case, a simple Web ...

Discover More
More WindowsTips

Configuring Windows to Do Backups on a Schedule

Performing regular backups of your system offers you peace of mind because you don't have to worry about data loss in the ...

Discover More

Getting Rid of Hidden Thumbs.db Files

A hidden file that the system uses to speed performance of your viewing folders containing pictures is called Thumbs.db. ...

Discover More

Saving a Windows Search

Windows has a built-in search utility that allows you to search for strings inside of files. You can even save your ...

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 two more than 7?

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


Newest Tips