If your Windows PC is stuck in a boot loop showing "Preparing Automatic Repair" or "Diagnosing your PC" followed by an error citing Srttrail.txt, do not panic. Srttrail.txt is simply a diagnostic log file generated by Windows Startup Repair to record checks and repair attempts—it is not a virus or corrupted file itself.
Follow this guide to back up your data and fix the repair loop.
Step 0: Back Up Your Personal Files (Recommended)
Before running repairs, you can safely copy your data from the Windows Recovery Environment (WinRE):
- Go to Advanced options > Troubleshoot > Advanced options > Command Prompt.
- Plug in an external USB drive.
- Locate your Windows drive letter by running
dir C:\Windows. If not found, try dir D:\Windows, dir E:\Windows, etc., until you see folders like System32.
- Type
diskpart, then list volume to identify your external USB drive's letter. Type exit to close DiskPart.
- Copy your user folder using Robocopy (replace
C: with your Windows drive and E: with your USB drive):
robocopy C:\Users E:\Backup\Users /E /R:1 /W:1
(Note: If your drive is encrypted with BitLocker, you will need your recovery key to access files).
How to Force Enter WinRE
If your computer does not automatically open the recovery options screen:
- Power on your PC.
- When the manufacturer or Windows logo appears, press and hold the Power button for 10 seconds to turn it off.
- Repeat this process 3 times. On the next boot, Windows should trigger Automatic Repair / WinRE.
Fix 1: Uninstall Recent Windows Updates
If the issue started right after a system update:
- In WinRE, select Troubleshoot > Advanced options > Uninstall Updates.
- Choose Uninstall latest quality update or Uninstall latest feature update.
- Follow the prompts, then restart your PC.
Fix 2: Repair System Files, Disk Errors, and Boot Data
Open Command Prompt from WinRE. Verify your Windows drive letter (assumed to be C: below):
Scan Disk (CHKDSK):
chkdsk C: /f
If errors are repaired, restart and test. If not fixed, continue.
Offline System File Checker (SFC):
sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
Restart if corrupted files are restored.
Repair Boot Code (BOOTREC):
Run the following commands one by one:
bootrec /fixmbr
bootrec /scanos
bootrec /rebuildbcd
If prompted to add the installation to the boot list, press Y and press Enter. Restart your computer.
Fix 3: Rebuild the EFI Boot Files
If boot entries are missing or corrupt, manually rebuild the boot configuration:
- Open Command Prompt in WinRE and type
diskpart.
- Type
list volume and locate the small FAT32 partition (the EFI System Partition).
- Select the partition and assign it a temporary letter:
select volume 2
assign letter=S
exit
(Replace 2 with your actual EFI volume number).
- Execute the BCDBoot command (replace
C: with your Windows drive letter):
bcdboot C:\Windows /s S: /f UEFI
- Close Command Prompt and restart your PC.
Fix 4: Check Hardware and BIOS/UEFI Settings
If the startup error repeatedly returns, underlying hardware or unstable settings may be causing file corruption:
- RAM: Disable XMP, EXPO, or memory overclocks in BIOS/UEFI. Run a bootable memory diagnostic test to check for hardware failure.
- Storage (SSD/HDD): Check the drive's SMART health status for bad or reallocated sectors.
- BIOS Defaults: Reset your motherboard firmware settings to default values.
Fix 5: Reinstall Windows
If soft repairs fail to break the loop:
- Create a bootable Windows installation USB using another PC.
- Insert the USB into the affected PC and boot from it.
- Select Install now, choose Custom installation, and install Windows on your system partition.
Prevention Tips
- Keep backups of critical files on an external drive or cloud service.
- Avoid unstable CPU/RAM overclocks and undervolting.
- Keep motherboard firmware and system drivers updated directly from hardware manufacturer support pages.