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

[Provider("CIMWin32")]class Win32_BootConfiguration : CIM_Setting
{
  string BootDirectory;
  string Caption;
  string ConfigurationPath;
  string Description;
  string LastDrive;
  string Name;
  string ScratchDirectory;
  string SettingID;
  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

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 description of the CIM_Setting object. This property is inherited from CIM_Setting.

ConfigurationPath
Data type: string
Access type: Read-only

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

Description of the CIM_Setting object. This property is inherited from CIM_Setting.

LastDrive
Data type: string
Access type: Read-only

Last drive letter to which a physical drive is assigned.

Example: "E:"

Name
Data type: string
Access type: Read-only
Qualifiers: Key, MaxLen (256)

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

ScratchDirectory
Data type: string
Access type: Read-only

Directory where temporary files can reside during boot time.

SettingID
Data type: string
Access type: Read-only
Qualifiers: MaxLen (256)

Identifier by which the CIM_Setting object is known. This property is inherited from CIM_Setting.

TempDirectory
Data type: string
Access type: Read-only

Directory where temporary files are stored.

Example: "C:\TEMP"

Remarks

The Win32_BootConfiguration class is derived from CIM_Setting.

Examples

The List the Boot Configuration Properties of a Computer Perl sample returns boot configuration information for a computer.

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

CIMWin32.mof

DLL

CIMWin32.dll

See also

Operating System Classes

 

 

Show:
© 2014 Microsoft