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

Logging In with Local vs. Microsoft Credentials

In Windows 10, you can choose to login using your local account or by using your Microsoft credentials. How to switch ...

Discover More

Ending a Process Using the Task Manager

One of the many functions of the Windows Task Manager is to allow you to control processes running on your system. If you ...

Discover More

Saving Search Queries

Windows Explorer has a good search utility built into it. As you use it, you may wish to save your commonly typed ...

Discover More
More WindowsTips

Backing Up Your Files

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

Encrypting a File Folder

Want to make the data stored on your system more secure? Think about enabling the built-in encryption capabilities of ...

Discover More

Displaying the Number of Files or Folders within a Folder

You can easily determine how many files and folders there are within a folder by making quick use of Windows Explorer or ...

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

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


Newest Tips