Wednesday, October 14, 2009

Boot Configuration Data: removing boot options in Windows Vista

If you tweaked boot options in Windows versions earlier than Vista, you're probably familiar with boot.ini and friends. Today I wanted to give Windows 7 a try and launched the upgrade from Windows Vista Ultimate to Windows 7 Ultimate. Despite the compatibility check performed by the installer did not complain about anything, the installation failed: system restarts always ended with a BSOD. Fortunately, the system upgrade process left Windows Vista untouched and I could boot into it and remove stale installation files.

The last thing I had to remove were the boot options corresponding to the Windows Setup program. Windows Vista introduced a new boot loader architecture and a set of commands to interact with the storage system which holds the boot loader configuration: bcdedit. bcdedit is the Windows Vista equivalent of Solaris' beadm. This is good news: no more tweaking ini files.

To view the current configuration you can issue the following command (beware that you must run the bcdedit command in a command prompt run as Administrator):

bcdedit /enum

Windows Setup
identifier              {cbd971bf-b7b8-4885-951a-fa03044f5d71}
device                  partition=C:
path                    \$WINDOWS.~BT\Windows\system32\winload.exe
description             Windows Setup
locale                  en-US
inherit                 {bootloadersettings}
osdevice                partition=C:
systemroot              \$WINDOWS.~BT\Windows
nx                      OptOut
detecthal               Yes
winpe                   Yes

To remove the Windows Setup boot menu entry I issued the following command:

bcdedit /delete {cbd971bf-b7b8-4885-951a-fa03044f5d71}

and the job was done.

No comments: