How to use Diskpart
Diskpart is a separate suite of commands that runs in the command window in its own shell. It is opened by first entering the command "diskpart" (without quotes) and then entering one of the various sub-commands that are listed in the section below. To return to the regular command line, enter "exit".
For Windows Vista and Windows 7 the command line must be opened with administrator privileges. These more recent versions of Windows contain features not available in Windows XP, as indicated in the list below. Also note that Windows XP does not allow operations on removable media whereas in Windows Vista/7, media such as USB keys can be the object of Diskpart operations.
Before carrying out an operation on a particular disk, partition, or volume it must first be selected with the "list disk", "list partition", or "list volume" sub-commands followed by a "select" command. For example, the necessary sequence of commands can be represented in this schematic way for a disk operation:
Open command line->open Diskpart shell->list disk->select disk->do disk operationA similar sequence would hold for a operation involving a partition or volume.
Diskpart exists as a separate executable file diskpart.exe and can also be accessed through the Run line or the Vista/7 search boxes.
Diskpart is a very powerful command and can easily wipe out the contents of a disk or volume so it must be used with great care. Always be sure which volume or disk you are operating on.