The quick answer, you're pretty much there. Check value of Current
in the key HKEY_LOCAL_MACHINE\SYSTEM\Select
. This will tell you which of the CurrentControlSet00X
's you need to make your change in.
For example, if Current
is set to 2
, you need to edit HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet002
with your changes.
The way it works is this:
Windows always keeps a few copies of this key, suffixed 001 to 003 (only 2 in Windows 7 I think?). CurrentControlSet001, CurrentControlSet002 and CurrentControlSet003. Think of them as the master keys that are persistent while the computer is switched off.
When you log into Windows, it picks the last used key, using the value of Current
in the HKEY_LOCAL_MACHINE\SYSTEM\Select
key. The content is copied into a key called HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
. This key is what Windows plays with while you are logged on.
When you log off of Windows, changes are written back to the key that was original copied from when you first logged on. CurrentControlSet002
for example. CurrentControlSet
vanishes, so to speak. This is why you are unable to see it while you are logged off, working from the recovery console :-)
Probably a bit over the top with my answer (I blame the Red Bull), but I figured I'd answer a detailed question with a detailed answer.
Aha! Fixed it!
As I noted in the thread on Microsoft Answers I linked to, there was no entry for the Recovery Environment from bcdedit
. There also wasn't one visible from EasyBCD. I did note they were in the registry, but they're shown by GUIDs there - not very navigable.
Thanks to this answer's suggestion of Visual BCD Editor, I was able to see the Recovery Environment entries in a friendly view.
Finally seeing the problem!
Thanks to the multiple runs of Startup Repair and manual repairing of the primary boot option, I had one working primary boot option and two Recovery Environment boot options. The (recovered) one, as seen in the screenshot below, was created during the Startup Repairs.
Click for full size
As seen in the screenshot below, the RecoverySequence
GUID of the primary boot option did not match the GUID of the recovered Recovery Environment (that's a mouthful!). Instead, it pointed to the corrupted Recovery Environment entry. Rather than attempting to link it to the (recovered) entry, I just fixed the original one and deleted the (recovered) one - especially since the (recovered) one has different GUIDs and inheritance settings.
Click for full size
Fixing the problem!
Before attempting manual repairs, backup the BCD file. This can be done under Store
> Backup Store
.
I linked ApplicationDevice
and OSDevice
in the original Recovery Environment option to the C:
partition. This is where the \Recovery\b9c42ebd-946e-11e0-8a47-f688fd0bc489\Winre.wim
file resides, and happens to be my primary OS partition. I've heard it's in a different place on some OEM machines: HP (and possibly others) create their own recovery partition that should be used. Note for anyone else following this: the GUIDs you see will be different.
Click for full size
I had to fix the Ramdisk Options
(linked to the GUID of the original Recovery Environment) entry: SdiDevice
had to be set to type PartitionDevice
, 'Drive' C:
, blank Path. To be honest, this was based off the DeviceOptions
created by Startup Repair and linked to the (recovered) Recovery Environment.
Click for full size
I then deleted the DeviceOptions
and Windows Recovery Environment (recovered)
entries.
Click for full size
Reboot, test, enjoy! This fixes Startup Repair on failed startup and Repair Your Computer
in the advanced boot options menu (F8 on startup).
Unfortunately, I haven't figured out how to add a Recovery Environment to a clean BCD store. I assume it would be just adding similar options, as seen in the screenshot.
Best Answer
Press F8 during boot
Select "Repair my computer"
Select the hard drive that windows is installed on
Choose
Command Prompt
from the next menuRun these commands to make a temporary copy of your registry
Examine the last modified dates of the Software, System and SAM files. Were the files created before your problem started?
If they were created before the problem started then type these commands:
(the two dots are part of each command)
Reboot. If things don't work, you can restore the original registry by copying the files from C:\Regback to C:\Windows\System32\config.