How to Fix the Automatic Repair Loop on Windows 11 [Fix]

How to Fix the Automatic Repair Loop on Windows 11 [Fix]

Your PC shows Preparing Automatic Repair, then Automatic Repair could not repair your PC, and the whole cycle starts again. The loop itself is not the diagnosis. It only means Startup Repair ran, could not fix the problem on its own, and handed you back to the same screen. The fix is to read the log Startup Repair leaves behind, find out which part of startup failed, and repair that part. The commands most guides hand out were written for older BIOS computers, and on a modern UEFI computer some of them do nothing at all.

Quick answer: open the Startup Repair log, SrtTrail.txt, and read the root cause it names. If it names a driver file, remove that driver. If it names a boot file or the boot configuration, rebuild the boot files with bcdboot, not with the legacy bootrec commands. If it points at the disk or the system files, run chkdsk and an offline SFC scan. If the log names the registry, check the automatic registry backup first, because on current builds that backup is usually empty.

Before you start, have your BitLocker recovery key ready if your drive is encrypted. Most recovery tools ask for the 48-digit key before they let you touch the drive. Also, on Windows 11 version 24H2 or later, quick machine recovery, on by default on Windows 11 Home, detects repeated boot failures and checks Windows Update for a fix. Restart once and give it a minute.

Read SrtTrail.txt before running any repair command

Startup Repair writes a plain text log of everything it tested and which test failed. Microsoft documents it at %windir%\System32\LogFiles\Srt\SrtTrail.txt, which on most PCs is C:\Windows\System32\LogFiles\Srt\SrtTrail.txt. What matters is the root cause section near the end, which usually names a file, a test, or an error code. That one detail decides which step below is yours.

  1. On the Automatic Repair screen, select Advanced options, then Troubleshoot, then Advanced options, then Command Prompt. If the PC never reaches that screen, force the recovery environment: turn the PC on, and as soon as the Windows or maker logo appears, hold the power button until it shuts off. Do that three times.
  2. Confirm which letter holds Windows in this session. The recovery environment often assigns a different letter than normal Windows. Type dir C:\Windows and press Enter. If the listing shows folders such as System32 and Users, that is your Windows drive. If not, try D:\Windows, then E:.
  3. Open the log with Notepad by typing notepad C:\Windows\System32\LogFiles\Srt\SrtTrail.txt, replacing C: with the letter you found. If Notepad opens an empty file, the path is wrong, so check the drive letter again.
  4. Scroll to the bottom and look for the lines that start with Root cause found, and for any line that names a file, such as a .sys driver file, winload.efi, or the BCD store. Note any error code next to it, such as 0xc0000225.

If the log is empty or stops suddenly, Startup Repair ended before it could finish writing. The failure happens early, so start with the disk check in Step 3 and the boot rebuild in Step 4.

What SrtTrail.txt namesLikely causeGo to
A .sys driver fileA driver that will not load, or is corruptStep 6, remove the driver
winload.efi, bootmgfw.efi, or the BCD storeDamaged boot files or configurationStep 4, rebuild with bcdboot
Disk or volume test failuresFile system damageStep 3, chkdsk and offline SFC
A registry hive that cannot loadRegistry damageStep 5, check RegBack first
A recent update, with no file namedA failed updateStep 6, uninstall the update
Nothing useful, or the log is emptyEarly failureWork Steps 3 and 4 in order
SrtTrail.txt branch diagram: a named driver file means remove the driver, a named boot file means rebuild with bcdboot, disk failures mean run chkdsk, a registry hive means check RegBack first

Step 1: Get into the recovery environment

Everything below happens inside the Windows Recovery Environment, known as WinRE. It runs outside your normal Windows installation, so its tools can fix files Windows itself cannot touch. If the Automatic Repair screen is already showing, select Advanced options and you are in. If not, use the three forced shutdowns above, or boot from a Windows 11 installation USB and select Repair your computer.

See also  Ways to Resolve the 'No Battery Is Detected' Error on Windows

While you are here, remove two cheap causes. Disconnect every peripheral except the keyboard and mouse, including USB drives, printers, and docks, because a faulty external device can stall startup before Windows even loads. If you added new hardware just before the loop started, shut the PC down and remove it. Microsoft lists removing new hardware as the first basic step for startup problems.

If the PC keeps dropping you back on the recovery screen before you can read anything, switch off the automatic loop so the real error shows instead. From the Command Prompt in WinRE, type bcdedit /set {default} recoveryenabled no and press Enter, then restart. Once the PC is fixed, turn it back on with bcdedit /set {default} recoveryenabled yes.

Step 2: Run Startup Repair once, then move on

Startup Repair is the tool that already failed, so running it again feels pointless, but run it once from the menu and let it finish. The loop often starts from a half-finished first attempt, interrupted by a forced shutdown, and a clean run sometimes completes the repair it started. Select Troubleshoot, then Advanced options, then Startup Repair, then Restart, and wait. Microsoft says the tool scans for missing or damaged system files, corrupted boot configuration data, a damaged master boot record, incompatible drivers, and registry errors. If the same screen comes back, do not run it a second time.

Step 3: Check the disk and repair the system files

A forced shutdown, a power cut, or a dying drive can corrupt the file system so badly that Windows cannot read its own files at startup. That is the most common cause of the loop after a bad update.

  1. Check the disk by typing chkdsk C: /f /r and pressing Enter, replacing C: with your Windows drive letter. The /f switch fixes file system errors, and /r finds bad sectors and recovers readable information, which includes everything /f does. This scan is slow, and on a damaged drive it can take an hour or more. Do not interrupt it. If it reports bad sectors it cannot recover, the drive itself is failing.
  2. Repair the system files with an offline scan. The normal sfc /scannow command cannot run here because Windows is not running, so point it at the offline installation instead: sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows, again replacing C: with your drive letter. The scan compares protected system files against known good copies.
  3. If the SFC scan says it could not repair some files, repair the Windows image it draws from. Type DISM /Image:C:\ /Cleanup-Image /RestoreHealth and press Enter, then run the offline SFC scan again. DISM repairs the component store that SFC uses as its source of clean files. Restart the PC. If Windows starts, the damage was in the file system or the system files.

Step 4: Rebuild the boot files the UEFI way

This is the step most guides get wrong. Nearly every PC sold in the last decade starts with UEFI firmware and a GPT disk, not with the old BIOS and MBR layout. On a UEFI computer, Windows starts from boot files on a small FAT32 partition called the EFI System Partition, and the boot configuration lives in a BCD store on that partition. The classic commands, bootrec /fixmbr and bootrec /fixboot, were written for the old layout: /fixmbr writes master boot record code, and /fixboot writes a legacy boot sector. On a UEFI system, /fixboot usually fails with Access is denied, because there is no legacy boot sector for it to write.

The correct tool on UEFI is bcdboot. Microsoft describes it as the command-line tool that configures the boot files on a PC, copying fresh boot files from your Windows folder to the system partition and creating a new BCD store.

  1. Confirm the layout first. Type diskpart, press Enter, type list volume, and press Enter. Look for a FAT32 volume of about 100 to 500 MB with no drive letter: that is the EFI System Partition, and it confirms the PC boots with UEFI. Note the letter of the large NTFS volume that holds Windows, then type exit.
  2. Try the simple rebuild first. Type bcdboot C:\Windows and press Enter, replacing C: with your Windows drive letter. This copies fresh boot files from your Windows folder and creates a new BCD store. Restart and see whether Windows starts.
  3. If the simple rebuild does not fix it, target the EFI System Partition directly. In diskpart, type list volume, then select volume N, replacing N with the number of the FAT32 EFI partition, then assign letter=S, then exit. Now type bcdboot C:\Windows /s S: /f UEFI and press Enter, then restart the PC.
  4. If the BCD store itself is the problem, rebuild it with bootrec. Type bcdedit /export C:\bcdbackup to save a copy, then attrib C:\boot\bcd -r -s -h, then ren C:\boot\bcd bcd.old, then bootrec /rebuildbcd. When it finds your Windows installation, type Y to add it to the boot list. Restart and test.
See also  How to Turn Off Voice Access in Windows 11
CommandWhat it repairsWhen to use it
bcdboot C:\WindowsBoot files and the BCD storeFirst rebuild attempt on UEFI
bcdboot C:\Windows /s S: /f UEFIUEFI boot files on the EFI partitionWhen the simple rebuild fails
bootrec /scanos and bootrec /rebuildbcdFinds Windows and rebuilds the BCD storeWhen the BCD store is damaged
bootrec /fixmbr and bootrec /fixbootMBR code and legacy boot sectorLegacy BIOS and MBR only, not UEFI
UEFI boot repair diagram: the EFI System Partition holds the boot files, bcdboot copies fresh boot files from the Windows folder and builds a new BCD store, bootrec fixmbr and fixboot only apply to legacy BIOS

One exception: if diskpart shows an MBR disk and no EFI System Partition, the PC really does boot with legacy BIOS. On that layout, run bootrec /fixmbr, then bootrec /fixboot, then bootrec /scanos, then bootrec /rebuildbcd, in that order. Microsoft documents the full bcdboot options on its BCDBoot command-line options page. See Microsoft Learn: BCDBoot Command-Line Options.

Step 5: Check the registry backup before you trust it

Many guides tell you to restore the registry from the automatic backup in C:\Windows\System32\config\RegBack. On a current Windows 11 PC, that advice is usually wrong. Microsoft changed this by design starting with Windows 10 version 1803: Windows no longer automatically backs up the registry to the RegBack folder. The folder still exists, but on a normal modern PC every file in it is 0 KB. Copying those empty files over your real registry hives would replace your registry with nothing, so check the sizes first.

  1. From the Command Prompt in WinRE, type dir C:\Windows\System32\config\RegBack and press Enter, replacing C: with your Windows drive letter. Read the sizes. If every file shows 0 KB, there is no backup to restore. Skip this step and go to Step 6, where System Restore is the supported way to undo registry damage.
  2. If the files have real sizes, the backup exists, which usually means the PC is older, or someone re-enabled the backup by hand. Protect the current hives first. Type cd C:\Windows\System32\config and press Enter, then rename each hive you plan to replace, for example ren SYSTEM SYSTEM.old. Never delete the current hives.
  3. Copy the backups into place with copy C:\Windows\System32\config\RegBack\SYSTEM C:\Windows\System32\config\SYSTEM and repeat for SOFTWARE, SAM, SECURITY, and DEFAULT. Restart the PC and see whether Windows starts.
  4. If Windows still will not start, put the originals back by renaming the .old files, then move on to Step 6.

The backup can be switched back on, but only while Windows is running, so it helps the next failure, not this one. Microsoft documents a registry value, EnablePeriodicBackup, under HKLM\System\CurrentControlSet\Control\Session Manager\Configuration Manager, which set to 1 makes Windows back up the registry to RegBack again. If RegBack is empty right now, System Restore is the tool Microsoft recommends, and that is Step 6.

RegBack check diagram: list the files in the RegBack folder, if every file is 0 KB there is no backup so use System Restore, only copy the hives when the files have real sizes

Step 6: Undo the last update or driver

If the loop started the morning after an update, or right after you installed a new driver, the newest change is the prime suspect. Windows keeps two ways to undo it from the recovery environment, and the right one depends on what changed. Both are gentler than a reset.

  1. If the loop began after a Windows update, uninstall it. Select Troubleshoot, then Advanced options, then Uninstall Updates. Choose Uninstall latest quality update, or Uninstall latest feature update if Windows recently moved to a new version. If the update is stuck halfway instead, clear it from the Command Prompt: DISM /Image:C:\ /Cleanup-Image /RevertPendingActions rolls back the pending update actions.
  2. If the SrtTrail.txt log named a driver file, remove that driver. Select Troubleshoot, then Advanced options, then Startup Settings, then Restart, and press 4 for Safe Mode. In Safe Mode, right-click Start, select Device Manager, find the device that owns the named driver, right-click it, and select Uninstall device. Restart normally.
  3. If neither of those fits, roll the system back with System Restore. Select Troubleshoot, then Advanced options, then System Restore, and pick a restore point from before the loop started. System Restore rolls back system files, settings, and drivers, but not your personal files. It only works if a restore point exists.
  4. On Windows 11 version 24H2 or later, check for point-in-time restore first, because Microsoft lists it ahead of System Restore. It rolls back the whole PC, including personal files, to an automatic snapshot, but its restore points only reach back about three days. Select Troubleshoot, then Point-in-time restore, and pick a point from before the loop started.
See also  How to Add a Printer on Windows 11 (Step-by-Step Guide)

Microsoft lists these recovery options from the least disruptive to the most. See Microsoft Support: Recovery options in Windows. If the loop started after a version upgrade, going back to the previous version is only possible for 10 days after the upgrade.

Step 7: Reset this PC and keep your files

If every step above has failed, the installation itself is damaged beyond what the repair tools can fix, and the remaining choice is a reinstall. Reset this PC is the least destructive form of it. Select Troubleshoot, then Reset this PC, then Keep my files. Windows reinstalls itself, keeps your personal files, and removes your installed apps and settings, which you will need to reinstall afterwards.

Before you confirm, back up anything that matters if you still can. The Command Prompt in WinRE can copy your user folders to a USB drive with robocopy, and it is worth doing even though Keep my files is supposed to preserve them. If the reset also fails, or the PC cannot see the drive at all, the drive itself is the likely fault.

If Windows starts now but stops with a blue screen

Sometimes the loop clears and a different error takes its place: Windows gets further into startup and then stops with a blue screen. That is progress, because a named stop code is a much clearer clue than a repair loop. If it says CRITICAL_PROCESS_DIED, our guide to fixing Critical Process Died on Windows 11 walks through identifying the process that died. If it says WHEA_UNCORRECTABLE_ERROR, the problem is a hardware fault, and our guide to fixing WHEA Uncorrectable Error on Windows 11 shows how to read the hardware error record and test one part at a time.

What to do with the result

  • Windows starts after chkdsk or SFC: the file system or the system files were damaged. Check the drive health.
  • Windows starts after bcdboot: the boot files or the BCD store were damaged. Write down what you did.
  • Windows starts after uninstalling an update or a driver: the update or driver was the cause.
  • Windows starts after a restore: the cause was a system change, and the restore undid it.
  • Windows starts after the RegBack restore: the registry was damaged and a real backup existed.
  • The loop returns no matter what you try: the drive, the memory, or the motherboard is the likely fault.

The automatic repair loop looks like a dead end, but it is a signpost. Startup Repair writes down what it found in SrtTrail.txt, and that log tells you whether the disk, the boot files, a driver, an update, or the registry is at fault. Read it first, then use the matching tool.

David Coleman
Scroll to Top