How to Rebuild Windows Recovery Environment From Command Prompt
🔍 WiseChecker

How to Rebuild Windows Recovery Environment From Command Prompt

Quick fix: Boot to Recovery Environment (force restart 3 times). Pick Troubleshoot → Advanced options → Command Prompt. Run: reagentc /disable to deactivate current WinRE. Then re-register with new WinRE.wim path: reagentc /setreimage /path C:\Recovery\WindowsRE. Then reagentc /enable. Reboot. WinRE rebuilt.

WinRE (Windows Recovery Environment) can corrupt. Symptoms: Reset This PC fails, Recovery menu missing, Startup Repair non-functional. To rebuild: disable, reset path, re-enable. Provide WinRE.wim file from ISO if missing.

Symptom: Need to rebuild Windows Recovery Environment from Command Prompt.
Affects: Windows 11.
Fix time: ~30 minutes.

ADVERTISEMENT

What causes this need

WinRE.wim file at C:\Recovery\WindowsRE\WinRE.wim can:

  • Get deleted accidentally (Disk Cleanup, partition deleted).
  • Corrupt after disk error.
  • Become outdated after major Windows update.
  • Get pointed to wrong location.

Rebuilding ensures: WinRE.wim is fresh and properly registered with BCD.

Method 1: Standard rebuild via reagentc

The standard route.

  1. Open Command Prompt as Admin.
  2. Check current status: reagentc /info.
  3. Disable WinRE:
    reagentc /disable

    This unregisters WinRE.

  4. Verify WinRE.wim exists at the location (C:\Recovery\WindowsRE\ by default).
  5. If missing: continue to Method 2 to extract from ISO.
  6. Set the reimage path:
    reagentc /setreimage /path C:\Recovery\WindowsRE
  7. Enable WinRE:
    reagentc /enable
  8. Verify: reagentc /info. Should show Enabled.
  9. Reboot. Recovery options available.

This is the standard route.

ADVERTISEMENT

Method 2: Replace WinRE.wim from Windows 11 ISO

For when WinRE.wim is missing.

  1. Download Windows 11 ISO from microsoft.com/software-download/windows11. Match your build.
  2. Mount: right-click .iso → Mount. Note drive (e.g., F:).
  3. Open Admin Command Prompt.
  4. Mount install.wim:
    md C:\Mount
    dism /Mount-Wim /WimFile:F:\sources\install.wim /index:1 /MountDir:C:\Mount /ReadOnly

    (Adjust /index: based on your Windows edition; see installed via dism /Get-WimInfo).

  5. Copy WinRE.wim:
    md C:\Recovery\WindowsRE
    copy C:\Mount\Windows\System32\Recovery\Winre.wim C:\Recovery\WindowsRE\
  6. Unmount install.wim:
    dism /Unmount-Wim /MountDir:C:\Mount /Discard
  7. Register WinRE: reagentc /setreimage /path C:\Recovery\WindowsREreagentc /enable.
  8. Reboot. Test recovery: Shift+Restart from Start menu.

This is the full restore.

Method 3: Rebuild from Recovery Environment

For when Windows won’t boot.

  1. Force restart 3 times to enter Recovery Environment.
  2. Pick Troubleshoot → Advanced options → Command Prompt.
  3. Identify Windows drive: diskpartlist vol → note the drive letter for Windows partition (in WinRE, may not be C:).
  4. Run the reagentc commands as in Method 1, with Windows path:
    reagentc /disable /target [WindowsDrive]:\Windows
    reagentc /setreimage /path [WindowsDrive]:\Recovery\WindowsRE /target [WindowsDrive]:\Windows
    reagentc /enable /target [WindowsDrive]:\Windows
  5. Exit. Reboot.
  6. For very broken WinRE: this from Recovery is the last resort.
  7. For Surface devices: Surface Recovery Image USB available from Microsoft. Boot from it.
  8. For specific WinRE-related Windows Update fail (KB5034441): use Microsoft’s KB5034957 tool to resize partition before rebuilding.

This is the from-Recovery route.

How to verify the fix worked

  • reagentc /info shows: Windows RE status: Enabled.
  • Settings → System → Recovery → Restart now (Advanced startup) → Recovery menu opens normally.
  • Shift+Restart from Start menu reaches Troubleshoot menu.
  • Reset This PC option available.

If none of these work

If rebuild fails: Disk full: free space before rebuild. Permission issues: ensure running as Admin. For BitLocker: suspend BitLocker first. For wrong WinRE.wim version: must match Windows build. For ISO not Windows 11: download correct version. For OEM PCs: vendor-specific WinRE may differ. Get vendor recovery USB. For chronic Recovery issues: in-place upgrade via Windows 11 ISO setup.exe. Repairs Recovery automatically. For chronic disk errors: drive may be failing. Test disk health. For dual-boot: WinRE for each Windows install — manage separately.

Bottom line: reagentc /disablereagentc /setreimage /path C:\Recovery\WindowsREreagentc /enable. If WinRE.wim missing: extract from Windows 11 ISO install.wim.

ADVERTISEMENT