Repair

Sometimes it can happen something is wrong with your Windows installation. Your PC won't start anymore. Before you start hunting down the problem you need to realize a few things:

- did I change anything since the last proper boot? Think about new drivers, new software, etc.

- might the noise from my HDD I heard last time be a clue?

- is my HDD working at all? Does the HDD light light up at boot time?

- did I do something with the registry?

Most problems can be solved using the escape route in Windows 7 by booting it into System Recovery mode (press F8 few times at boot)

You can choose to revert the system to a previous restore point.

The System Recovery is loaded from an extra HDD partition (100 Mb) and is just like a PE environment. No need for A DVD or bootable USB stick.

If there is a NTFS filesystem fail you can try to repair it with chkdsk in System Recovery mode Command Prompt.

Another good option is to use Hirens or BartPE from an usb stick or cdrom. Boot your PC with it.

This MiniNT or PE environment is just enough to do so repairs. Make sure your HDD controller is supported to see your HDD in PE.

Windows 7 System Recovery boot from USB stick

Create a Win7 PE bootable USB stick: http://www.7tutorials.com/create-usb-memory-stick-system-recovery-tools

Repair the registry

Regedit is basically just a database editor. It loads some registry hives (each a database) like HKCR, HKCU and classes, HKLM Software and System and SAM. These databases are stored on the OS disk in C:\Windows\System32\Config.

A System Restore Point also includes a copy of it. These are stored in C:\System Volume Information. In XP it was easy to get the earlier saved registry from it. In Windows 7 I have not found a tool that can do that.

When booted into PE you start Regedit. This will load the Registry from PE, not that of your system.

In Regedit select the HKEY_LOCAL_MACHINE hive. Then from the File menu select Load Hive...

Find your system HDD and navigate to <drive>:\Windows\System32\Config. Find SYSTEM and click Open.

Now give it a name (e.g. mysystem). This name now shows up as a new Hive in Regedit.

If you need to repair something in HKLM\System\CurrentControlSet you now need HKLM\mysystem\controlsetXXX where XXX can be found in HKLM\mysystem\select current. If current is 3 you need HKLM\mysystem\controlset003.

After editing DON'T forget to goto the File menu and click Unload Hive.

Restart your PC.

Edit: you can create live copy of the PC registry using my CopyRegistryLiveWithVSS.cmd script.

Repair the software (windows update) database

First try installing this july 2016 windows 7/2008 Microsoft Update: https://support.microsoft.com/en-us/kb/3172605

Windows update uses a database called C:\Windows\SoftwareDistribution\DataStore\DataStore.edb that sometimes needs some attention.

It is good practice to defragment/compact it. Also you can check its integrity or repair it.

If Windows Update has high cpu and there is no progress you can stop the Windows Update Service and do integrity check and compact.

Check integrity

ESENTUTL.EXE /g "C:\Windows\SoftwareDistribution\DataStore\DataStore.edb"

Compact it

ESENTUTL.EXE /d "C:\Windows\SoftwareDistribution\DataStore\DataStore.edb"

For more options use ESENTUTL.EXE /?

Also clearing the log files might help. You can do this with a script:

net stop wuauserv

net stop trustedinstaller

Del /F /Q C:\Windows\Logs\CBS\*.*

net start trustedinstaller

net start wuauserv

Next try the Windows Update fix tool from Microsoft: http://go.microsoft.com/?linkid=9830262

If that also doesn't help your last resort is the Microsoft System Update Readyness Tool to repair.

Single core to Multi core procedure

Up to Windows 2003 if you have trouble with windows hal finding the other CPU's this will do the trick. In Windows Task Manager you can see only one CPU and you cannot select "View -> CPU History -> One graph per CPU" because it is greyed out. If you look into the hardware tree you probably see that windows has detected multiple CPU's. The problem is the HAL driver.

Start regedit and goto HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\0000 and you will see a value HardwareID with acpiapic_up.

Now take permissions on that ACPI_HAL\0000 key (like everyone change) and change the HardwareID value to acpiapic_mp.

Change permission back to everyone read.

Now goto the hardware tree, select Computer -> the ACPI and right click and select Update driver...

Now select ACPI Multiprocessor PC. Reboot and now you see the multiple CPU's in Task Manager.

High cpu on iphlpsvc (25%)

netsh int ipv6 6to4 set state disabled

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\iphlpsvc\config]

"Enable6to4"=dword:00000003 ; was 2

Register and install all existing Apps on disk again

For /f "delims=" %%X in ('Dir /b /s "C:\Program Files\WindowsApps\AppxManifest.xml" ^| FindStr /V Deleted') Do Powershell "Add-AppxPackage -DisableDevelopmentMode -Register '%%X'"

https://www.tenforums.com/bsod-crashes-debugging/123444-bsod-inaccessible-boot-device-2.html