Darby Lamb

← Fix log · 2026-10-16

A Windows repair loop, a healthy drive, and one corrupt registry file

My first LambTech PC customer job. A 2017 all-in-one stuck in Automatic Repair. The drive was fine; one registry hive wasn't. How I saved everything first, found the cause, and put every file back where it lived.

Windowsdata recoveryregistryOneDriveLambTech PCtroubleshooting

The problem

A customer brought in a 2017 Lenovo all-in-one stuck in Windows 10's "Preparing Automatic Repair" loop. It had years of work files on it, and no recent backup that anyone knew of.

The usual guess for a machine that age is a dying hard drive. It had a 1 TB, 5400 rpm laptop drive and no SSD. But the rule on a customer machine is data first, diagnosis second: nothing writes to that drive until the files are safe.

Step 1: look without touching

Step 2: back everything up, twice, and verify

I wired the customer PC straight to my workstation with an Ethernet cable on its own isolated port: link-local addressing, no gateway, one shared folder, a dedicated login, and firewall rules scoped to that port. A possibly-infected customer machine can reach that one folder and nothing else on my network.

Step 3: find the actual cause

An offline repair pass from the PE environment (revert pending update actions, chkdsk /f, offline SFC, DISM ScanHealth, bcdboot) gave the answer in two lines:

Error: 1009. The configuration registry database is corrupt.

A small script tried reg load on each hive. SYSTEM, SOFTWARE, SAM, DEFAULT, COMPONENTS, DRIVERS and the user's NTUSER.DAT all loaded. SECURITY did not. Windows 10's RegBack folder was empty (it's been off by default since 2018), and there were no usable restore points.

I tried replacing SECURITY with a clean stock hive (corrupt one kept, renamed). Windows got further than before, then blue-screened with 0xC00002E3: the Security Account Manager couldn't start, because a stock SECURITY hive doesn't match that machine's SAM. With no matching copy anywhere, in-place repair was a dead end, so I recommended a fresh install, and the customer approved it.

Step 4: reinstall, then restore it like nothing happened

A clean Windows 10 install activated on its own from the key in the firmware. The harder part was making it feel like their computer again.

I read the old user settings offline. reg load refused the copied NTUSER.DAT, so I parsed it with Python (python-registry) instead. Three keys told me everything:

So the restore put every file back in its original path (merging, never overwriting anything newer), turned OneDrive folder backup back on so it all uploaded, and rebuilt 60 deleted-but-not-emptied files from the Recycle Bin's $I/$R pairs under their real names. Office came back by signing in: the account already owned the license.

Two last gotchas: OneDrive pointed Documents at a brand-new empty Documentos folder (fixed with Location → Move), and the Office installer can't download over the isolated bench cable (it needs real internet, obviously).

Handback

A cleanup script removed my Wi-Fi profile, logs, Explorer history and Start-menu clutter, then reported activation, Secure Boot, device status, folder locations and Office licensing in one pass. Secure Boot went back on. The customer got a two-page report with clickable next steps on their desktop (Settings pages, OneDrive, account security), and my copies of their data are set to be deleted two weeks after pickup.

Lessons

Every script from this job is now a reusable template for the next one.