Create Windows Recovery Environment for Windows 8

  1. Create Recovery partition
    create partition primary size=300
    format quick fs=ntfs label=”Windows RE tools”
    assign letter=”R”
    set id=”de94bba4-06d1-4d40-a16a-bfd50179d6ac”
    gpt attributes=0x8000000000000001
  2. Copy winpe.wim R:\Recovery\WindowsRE\winre.wim
    Customize winre.wim if want more options.
  3. Copy ReAgent.xml C:\Windows\System32\Recovery\ReAgent.xml
    This step can be omitted if ReAgentc function work fine, else copy the blank ReAgent.xml.
  4. Copy captured system image to D:\Recovery\WindowsIamge\install.wim
    It has to be install.wim. It can be in any location, which will be linked by ReAgentc.
  5. Sets the location of the custom Windows RE image.
    REAGENTC.EXE /setreimage /path r:\Recovery\WindowsRE
    REAGENTC.EXE /setreimage /path r:\Recovery\WindowsRE /target C:\Windows
  6. Sets the location of the recovery image used by system reset.
    REAGENTC.EXE /setosimage /path d:\Recovery\WindowsIamge /index 1
  7. Enables Windows RE.
    REAGENTC.EXE /enable
  8. Displays Windows RE and system reset configuration infomration.
    REAGENTC.EXE /info
  9. Create a push-button reset configuration file (Optional)
    Save it to the same location of install.wim
    This is the full sample of ResetConfig.xml
    <?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>
  10. Add custom tools to WinRE.wim (Optional)
    Mount WinRE.wim and copy WinREConfig.xml to mountdir\sources\recovery\tools\WinREConfig.xml
    Unmount with /commit to save WinRE.wim.
    Sample of WinREConfig.xml
    <?xml version=”1.0″ encoding=”utf-8″?>
    <!– \sources\recovery\tools\WinREConfig.xml –>
    <Recovery>
    <RecoveryTools>
    <RelativeFilePath>OEMDiagnostics.exe</RelativeFilePath>
    <CommandLineParam>/param1 /param2</CommandLineParam>
    </RecoveryTools>
    </Recovery>
  11. In Windows, open the Settings charm > More PC settings > General. In Advanced startup, click Restart now.  Or
    In Windows, open the Settings charm, and then hold the Shift key while clicking Restart.  Or
    From a command prompt, run the Shutdown /r /o command.  Or
    Boot the computer by using recovery media
  12. MS reference document: http://technet.microsoft.com/en-us/library/hh825051.aspx
Advertisements
This entry was posted in Windows. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s