Win32_BootConfiguration class

The Win32_BootConfiguration WMI class represents the boot configuration of a computer system running Windows.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties are listed in alphabetic order, not MOF order.

Syntax

[Dynamic, Provider("CIMWin32"), UUID("{8502C4E2-5FBB-11D2-AAC1-006008C78BC7}"), AMENDMENT]
class Win32_BootConfiguration : CIM_Setting
{
  string Caption;
  string Description;
  string SettingID;
  string BootDirectory;
  string ConfigurationPath;
  string LastDrive;
  string Name;
  string ScratchDirectory;
  string TempDirectory;
};

Members

The Win32_BootConfiguration class has these types of members:

Properties

The Win32_BootConfiguration class has these properties.

BootDirectory

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Process and Thread Functions|GetEnvironmentVariable|WinBootDir")

Path to the system files required for booting the system.

Example: "C:\Windows"

Caption

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64)

Short textual description of the current object.

This property is inherited from CIM_Setting.

ConfigurationPath

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Process and Thread Functions|GetEnvironmentVariable|WinBootDir")

Path to the configuration files. This value may be similar to the value in the BootDirectory property.

Description

Data type: string

Access type: Read-only

Textual description of the current object.

This property is inherited from CIM_Setting.

LastDrive

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|File Functions|GetDriveType")

Last drive letter to which a physical drive is assigned.

Example: "E:"

Name

Data type: string

Access type: Read-only

Qualifiers: key, MaxLen (256), MappingStrings ("WMI")

Name of the boot configuration. It is an identifier for the boot configuration.

ScratchDirectory

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|File Functions|GetTempPath")

Directory where temporary files can reside during boot time.

SettingID

Data type: string

Access type: Read-only

Qualifiers: MaxLen (256)

Identifier by which the current object is known.

This property is inherited from CIM_Setting.

TempDirectory

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|File Functions|GetTempPath")

Directory where temporary files are stored.

Example: "C:\TEMP"

Remarks

The Win32_BootConfiguration class is derived from CIM_Setting.

Examples

The following VBScript sample returns boot configuration information for a computer.

On Error Resume Next 
 
strComputer = "." 
Set objWMIService = GetObject("winmgmts:" _ 
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
 
Set colItems = objWMIService.ExecQuery("Select * from Win32_BootConfiguration") 
 
For Each objItem in colItems 
    Wscript.Echo "Boot Directory: " & objItem.BootDirectory 
    Wscript.Echo "Configuration Path: " & objItem.ConfigurationPath 
    Wscript.Echo "Description: " & objItem.Description 
    Wscript.Echo "Last Drive: " & objItem.LastDrive 
    Wscript.Echo "Name: " & objItem.Name 
    Wscript.Echo "Scratch Directory: " & objItem.ScratchDirectory 
    Wscript.Echo "Setting ID: " & objItem.SettingID 
    Wscript.Echo "Temp Directory: " & objItem.TempDirectory 
Next 

The following code sample demonstrates the use of the Win32_BootConfiguration WMI class.

# Get Boot configuration from WMI

$boot = Get-WMIObject Win32_BootConfiguration

# Display information

"Boot Directory     : {0}" -f $boot.bootdirectory
"Caption            : {0}" -f $boot.caption
"Description        : {0}" -f $boot.description
"Last Drive         : {0}" -f $boot.lastdrive
"Scratch Directory  : {0}" -f $boot.scratchdirectory
"Temp Directory     : {0}" -f $boot.tempdirectory

The previous code sample creates the following output:

Boot Directory     : \WINDOWS
Caption            : \Device\Harddisk0\Partition1
Description        : \Device\Harddisk0\Partition1
Last Drive         : K:
Scratch Directory  : C:\WINDOWS\system32\config\systemprofile\Local Settings\Temp
Temp Directory     : C:\WINDOWS\system32\config\systemprofile\Local Settings\Temp

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMV2
MOF
CIMWin32.mof
DLL
CIMWin32.dll

See also

CIM_Setting

Operating System Classes