SetPartitionDeviceElementWithFlags method of the BcdObject class

Sets the specified partition device element. This method is identical to SetPartitionDeviceElement except it takes additional flags.

Syntax

boolean SetPartitionDeviceElementWithFlags(
  [in] uint32 Type,
  [in] uint32 DeviceType,
  [in] string AdditionalOptions,
  [in] string Path,
  [in] uint32 Flags
);

Parameters

Type [in]

The element type. This parameter is one of the Device element types from the following enumerations:

It can also be a custom element type created for your own use.

DeviceType [in]

The device type. This parameter can be one of the following values.

Value Meaning
BootDevice
1
Device that initiated the boot.
FileDevice
3
File that contains file system metadata and is treated as a device.
PartitionDevice
2
Disk partition.
RamdiskDevice
4
Ramdisk.
UnknownDevice
5
Unknown.

AdditionalOptions [in]

A GUID in string form with surrounding braces that represents another object in the store, or the empty string ("").

Path [in]

The path to the partition that contains the element to set.

Flags [in]

This parameter can be zero or the following value.

Value Meaning
DisableVhdDeviceDetection
32
Disable virtual hard disk (VHD) detection. Specify this flag if the partition will be used to boot a virtual machine.

If this parameter is zero, VHD detection is enabled. For more information, see Remarks.

Remarks

By default, the SetPartitionDeviceElementWithFlags method detects whether the specified device path is backed by a VHD. If so, it creates a boot device using the VHD file information so that the device can be mounted on a physical machine at boot time. However, this type of VHD boot device is not compatible with a virtual machine. To suppress automatic VHD detection, specify the DisableVhdDeviceDetection flag when creating boot devices that will be used by the boot process of a virtual machine.

Requirements

Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
Windows Server 2008 R2 [desktop apps only]
Namespace
Root\WMI
MOF
Bcd.mof

See also

BcdObject

SetPartitionDeviceElement