Compartir a través de


ResetConfig XML Reference

Applies To: Windows 8.1, Windows Server 2012, Windows Server 2012 R2

This reference describes all XML elements that are used to author the ResetConfig.xml file, used to configure Windows Recovery Environment push-button reset features.

Reset

The Reset XML element can contain the elements: Run and SystemDisk.

Run

The Run XML element is used to add custom scripts to push-button reset features. For more information, see Add a Script to Push-Button Reset Features.

You can specify up to four Run elements in a single ResetConfig.xml file. Each Run element must contain a different [ExtPoint] value for the Phase attribute.

The following table describes the valid elements that can be added to the Run element:

Element Description

Phase="[ExtPoint]" attribute

Defines the extensibility point to use, the script that runs at that extensibility point, and the estimated duration, in minutes.

The Phase attribute is required. It accepts only the following values for [ExtPoint]:

  • BasicReset_BeforeImageApply. Runs the specified program at extensibility point A.

  • BasicReset_AfterImageApply. Runs the specified program at extensibility point B

  • FactoryReset_AfterDiskFormat. Runs the specified program at extensibility point C

  • FactoryReset_AfterImageApply. Runs the specified program at extensibility point D

Path element

Specifies the location of the script for a particular Run section.

The path must be the relative path of the script from the folder that contains the Install.wim and ResetConfig.xml files on the recovery image partition.

Note
The read and write permissions for the specified scripts and executable files, including their dependencies, must be set to require administrative user rights.

Duration element

Specifies the estimated time, in minutes, that the extensibility point takes to run. The duration must be an integer and must be between 1 and 5.

Param element

Specifies the command-line parameters to use when you run the custom script or executable file. The value is treated as a string, and can contain multiple parameters.

Param does not support empty elements. If your script does not require parameters, then do not include this element. For examples, see Using ResetConfig.xml later in this topic.

SystemDisk

The SystemDisk XML element is used by the ResetConfig.xml file to create recovery media. For more information, see Create Media to Run Push-Button Reset Features.

You can specify one SystemDisk section in a single ResetConfig.xml file.

Several of these elements must exist in order for your user to be able to repartition their hard drive as needed using the push-button reset tools.

The following table describes the valid elements that can be added to the SystemDisk element:

Element Description

WIMBoot element

Specifies whether the PC is configured for Windows image file boot (WIMBoot). This setting is new for Windows 8.1 Update. For more info on WIMBoot, see Windows Image File Boot (WIMBoot) Overview.

For WIMBoot PCs, set this value to a non-zero value when preparing recovery media with the SystemDisk element.

When this value is used, these are additional requirements. If any of these checks fail, your user won't be able to repartition the hard drive.

  • <WindowsREPartition> and <RecoveryImagePartition> must have the same value.

  • <RestoreFromIndex> and <RecoveryImageIndex> must have the same value.

  • The value for <RecoveryImagePath> must be set to Windows Images.

For non-WIMBoot PCs, do not include this element.

MinSize element

Specifies the minimum required size for the primary hard drive, in megabytes.

If this element is not included, your user won't be able to repartition the hard drive.

If the actual size of the drive is smaller than the specified size, an error message appears when your user attempts to repartition the drive.

DiskpartScriptPath element

Specifies the location and name of the script used to repartition the hard drive. The path should be a relative path, based on the location of the recovery image, and should not begin with a backslash (\). For example, if the recovery image is located at R:\Recovery, and the Diskpart script is located at R:\Recovery\Fabrikam\RecreatePartitions.txt, then the relative path should be Fabrikam\RecreatePartitions.txt.

The Diskpart script must recreate each of the partitions needed to restore the hard drive.

If this element is not included, your user won't be able to repartition the hard drive.

OSPartition element

Specifies the partition where Windows is installed. The partition number represents a drive partition on the primary hard drive.

If this element is not included, your user won't be able to repartition the hard drive.

RestoreFromIndex element

Specifies the index number of the image in the Windows image file (.wim) that is used by the recovery image when push-button reset (Install.wim) is applied to the recovery partition.

If this element is not included, your user won't be able to repartition the hard drive.

WindowsREPartition element

Specifies the partition where the Windows RE boot image is installed.

The WindowsREPartition and WindowsREPath elements are optional, but they must be used together. If only one of these elements is present, your user won't be able to repartition the hard drive.

WindowsREPath element

Specifies the folder path where the Winre.wim boot image is copied and staged, relative to the root of the partition specified in the WindowsREPartition element.

The WindowsREPartition and WindowsREPath elements are optional, but they must be used together. If only one of these elements is present, your user won't be able to repartition the hard drive.

RecoveryImagePartition element

Specifies the partition where the push-button reset recovery image and its associated extensibility scripts are copied to.

The RecoveryImagePartition, RecoveryImagePath, and RecoveryImageIndex elements are all optional, but they must be used together. If only one or two of these elements are present, your user won't be able to repartition the hard drive.

RecoveryImagePath element

Specifies the folder path that the recovery image (install.wim) and the push-button reset extensibility scripts, relative to the root of the partition specified by the RecoveryImagePartition element.

The RecoveryImagePartition, RecoveryImagePath, and RecoveryImageIndex elements are all optional, but they must be used together. If only one or two of these elements are present, your user won't be able to repartition the hard drive.

RecoveryImageIndex element

Specifies the index number of the image in the .wim container, used to register the push-button reset (Install.wim) recovery image to the recovery partition.

The RecoveryImagePartition, RecoveryImagePath, and RecoveryImageIndex elements are all optional, but they must be used together. If only one or two of these elements are present, your user won't be able to repartition the hard drive.

Note

Secondary hard drives are not modified during the push-button reset processes.

Using ResetConfig.xml

If you use a text editor to author your .xml files, you must save the document with an .xml file name extension, and use UTF-8 encoding. You must not use ANSI coding.

You must place the ResetConfig.xml file in the same folder as the recovery image for push-button reset (Install.wim), on the recovery image partition. For each registered extensibility point, push-button reset first searches for customizations, such as custom scripts and executable files, in the \Sources\Recovery\Tools path on the Windows RE tools partition. Then, push-button reset searches the recovery image partition.

Example

This is a code example for the ResetConfig.xml file.

<?xml version="1.0" encoding="utf-8"?>
<!-- ResetConfig.xml -->
   <Reset>
      <Run Phase="BasicReset_BeforeImageApply">
         <Path>SaveLogFiles.cmd</Path>
         <Duration>4</Duration>
      </Run>      
      <Run Phase="BasicReset_AfterImageApply">
         <Path>RetrieveLogFiles.cmd</Path>
         <Param>/allApps</Param>
         <Duration>2</Duration>
      </Run>
      <Run Phase="FactoryReset_AfterDiskFormat">
         <Path>CheckPartitions.exe</Path>
         <Duration>2</Duration>
      </Run>
      <Run Phase="FactoryReset_AfterImageApply">
         <Path>InstallApps.cmd</Path>
         <Param>/allApps</Param>
         <Duration>2</Duration>
      </Run>
      <SystemDisk>
         <DiskpartScriptPath>ResetPartitions-UEFI.txt</DiskpartScriptPath>
         <MinSize>75000</MinSize>
         <WindowsREPartition>1</WindowsREPartition>
         <WindowsREPath>Recovery\WindowsRE</WindowsREPath>
         <OSPartition>4</OSPartition>
         <RecoveryImagePartition>5</RecoveryImagePartition>
         <RecoveryImagePath>RecoveryImage</RecoveryImagePath>
         <RestoreFromIndex>1</RestoreFromIndex>
         <RecoveryImageIndex>1</RecoveryImageIndex>
      </SystemDisk>
   </Reset>

This is a code example for the ResetConfig.xml file on a PC configured for WIMBoot.

<?xml version="1.0" encoding="utf-8"?>
<!-- ResetConfig.xml for WIMBoot -->
   <Reset>
      <SystemDisk>
         <WIMBoot>1</WIMBoot>
         <DiskpartScriptPath>ResetPartitions-UEFI-WIMBoot.txt</DiskpartScriptPath>
         <MinSize>75000</MinSize>
         <WindowsREPartition>4</WindowsREPartition>
         <WindowsREPath>Recovery\WindowsRE</WindowsREPath>
         <OSPartition>3</OSPartition>
         <RecoveryImagePartition>4</RecoveryImagePartition>
         <RecoveryImagePath>Windows Images</RecoveryImagePath>
         <RestoreFromIndex>1</RestoreFromIndex>
         <RecoveryImageIndex>1</RecoveryImageIndex>
      </SystemDisk>
   </Reset>

See Also

Tasks

Add a Script to Push-Button Reset Features
Create Media to Run Push-Button Reset Features

Concepts

Push-Button Reset Overview