Custom Bootstrap Actions - Windows 8/7/Vista

Create keyboard shortcuts to boot loaders/applications

 

Microsoft has designed a mechanism in Windows 7/Vista that supports the ability to define actions to perform in response to a keyboard scan code that is received during boot.

The mechanism is intended for OEM's but normal users may use it too.

As a user you can associate a dedicated key (or key combination) to a boot loader and use it at boot time as a shortcut.

Using 'bcdedit.exe' it is done with following commands:

  1. bcdedit -set {bootmgr} custom:0x54000001 {GUID_loader}
  2. bcdedit -set {bootmgr} customactions 0x1000044000001 0x54000001

The first command creates an oem custom element for the {bootmgr} object with id 0x54000001 and gives it as value "{GUID_loader}". {GUID_loader} is for example the {GUID} of Windows 7 loader on your computer.

The second command creates a 'customactions' element. The 'customactions' element is a list of hexadecimal pairs where each pair is in essence (key scan code + oem custom element id). In the example 4400 is the scan code of keyboard key 'F10'.

 

Instead of typing bcdedit commands you can use the GUI interface of Visual BCD Editor to easily create and edit custom actions.

CustomActions

In the Key combo you can choose from more than 100 key codes by symbolic name and forget about hexadecimals. In the Action combo you can choose among available loaders on your system by name and forget about GUID's.

Just select the needed values and confirm and you are done. You can either create a new custom action or edit an existing (if the oem element/index already exists). Don't forget the rule: oem custom elements must start from 0x54000001 and be consecutive !

On some computers for certain key scan codes (extended scan codes) you have to enable extended keyboard input. This is done by creating the element 'ConsoleExtendedInput' (under Library elements) for object {globalsettings} and setting it to 'true' or alternatively using bcdedit:

bcdedit.exe /set {globalsettings} extendedinput 1

Note 1: On my Acer Notebook extended key scan codes seem to be enabled by default without the need of specifying extended input. (Tested with F9, Alt+8, Shift+F7, Ctrl+F6, Alt+K, Alt+F5 which means that at least 50 scan codes in the extended range are received without specifying extended console input).

Note 2: It seems that you can specify the element 'ConsoleExtendedInput' also as an element of the {bootmgr} object (instead of being an element of object {globalsettings}).

 

How to use

One way to use custom actions is to have a keyboard shortcut as an additional way of activating a loader.

A second way is to delete the menu entry of the loader and create a shortcut. So the loader can be activated only by the shortcut at boot time.

If the menu entry for a loader is deleted (the GUID of the loader) from 'DisplayOrder' element in {bootmgr} object, the loader object is still present in BCD and can be accessed at boot time by a shortcut key if a customactions element has been created for that loader. So the loader is hidden and cannot be accessed by anybody who does not know about the shortcut.

This way you can hide other OS(Windows XP, Ubuntu) or Windows 7 recovery from other people using your computer.

To take away recovery from the boot menu (on F8 - advanced boot options) you should delete elements 'RecoverySequence' and 'RecoveryEnabled' from the recovery loader object and create a shortcut to it so you can still access it when needed.

 

 

Original Microsoft Document: Custom Bootstrap Actions in Windows Vista

 

 

It takes some time and effort to code apps and maintain a website, and liters of coffee ;)

paypal