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

How to Change Drive Letters

Windows is quite configurable. It even allows you to change the drive letters associated with your disk drives. Although ...

Discover More

Understanding Action Center

Action Center provides you with a quick overview of security and maintenance issues and allows you to drill down to the ...

Discover More

Understanding Types of DVDs

There are several types of DVDs on the market. This tip explains the various types and how you might use them.

Discover More
More WindowsTips

Using Folder Templates

Windows is highly customizable. One way you can customize it is by changing what the File Explorer looks like. This can ...

Discover More

Getting Information about Files Searched For

Do a search for files on your computer and you may need to see more information about the results than what Windows first ...

Discover More

Creating and Using Compressed Folders

If you're low on disk space but still want to keep your files online, you might consider moving them to compressed ...

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 1 + 1?

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


Newest Tips