Changes the partition type field for the partition with focus.

For examples of how this command can be used, see Examples.

Syntax

set id=<byte|GUID> [override] [noerr]

Parameters

Parameter Description

id=<byte|GUID>

Specifies the new value for the partition type field. If the partition format is master boot record (MBR), use a byte value. If the partition format is GUID partition table (GPT), use a GUID value.

override

Enables DiskPart to force the volume to dismount first if necessary. If the volume is forcefully dismounted, some open handles (files in use by an application) to that volume can become invalid.

noerr

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.

Remarks

  • This command does not work on dynamic disks.

  • A syntax error results if the new partition type field value is not specified.

  • DiskPart does not check the type field of the partition with focus for validity, nor does it perform any other checking of the ID parameter.

Examples

set id=0x07 override
set id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7

Additional references