Updated: June 20, 2016
Applies To: Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista
The Diskpart Set ID command changes the partition type field for the partition with focus.
This command is intended for use by original equipment manufacturers (OEMs) only. Changing partition type fields with this parameter might cause your computer to fail or be unable to boot. Unless you are an OEM or experienced with GPT disks, you should not change partition type fields on GPT disks by using this parameter. Instead, always use the Create partition efi command to create EFI system partitions, the Create partition msr command to create Microsoft Reserved partitions, and the Create partition primary command without the ID parameter to create primary partitions on GPT disks.
For examples of how this command can be used, see Examples.
For master boot record (MBR) disks, specifies the new value for the type field, in hexadecimal form, for the partition. Any partition type byte can be specified with this parameter except for type 0x42, which specifies an LDM partition. Note that the leading “0x” is omitted when specifying the hexadecimal partition type.
For GUID partition table (GPT) disks, specifies the new GUID value for the type field for the partition. Recognized GUIDs include:
Any partition type GUID can be specified with this parameter except the following:
Forces the file system on the volume to dismount before changing the partition type. When you run the Set id command, DiskPart attempts to lock and dismount the file system on the volume. If override is not specified, and the call to lock the file system fails (for example, because there is an open handle), the operation will fail. When override is specified, DiskPart forces the dismount even if the call to lock the file system fails, and any open handles to the volume will become invalid.
This command is only available for Windows 7 and Windows Server 2008 R2.
Used for scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code.
Other than the limitations previously mentioned, DiskPart does not check the validity of the value that you specify (except to ensure that it is a byte in hexadecimal form or a GUID).
This command does not work on dynamic disks or on Microsoft Reserved partitions.