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

Starting Windows 10 in Safe Mode

Hopefully you'll never find yourself in a situation where you need to restart your computer in Safe Mode. If you do, ...

Discover More

Ripping Songs from Audio CDs

Ripping songs from audio CDs is fairly simple, but the actual process varies from application to application.

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
More WindowsTips

Illegal Windows Names

When it comes to files and folders and naming them in there are restrictions. Knowing what is restricted will help you ...

Discover More

Renaming Multiple Files at the Same Time

It's possible to rename multiple files at the same time, but the new names of the files may leave a bit to be desired. ...

Discover More

Understanding Robocopy

Robocopy is a robust file copy utility built into Windows. If you have a lot of file management to do that can't easily ...

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 8 - 5?

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


Newest Tips