This post describes key steps which one should take in order to make a UnBootable windows operating system as Bootable. Often we see that during operation or after recovery, operating system shows various errors like BTMGR is missing or The Windows Boot Configuration Data file is missing required information etc. In the end of the post I’ve emphasized on important sfc command for system files repair and dsim command for system image repair (As In Windows 10).


Introduction

As mentioned in excerpt, many times during Windows Crash or Windows Recovery to same or diffrent hardware via many tools like Acronis Backup, Norton Ghost etc. System renders unbootable with messages as shown below in Windows 7, 8 and 10 operating systems.

  • BOOTMGR is missing
  • Press Ctrl Alt Del to restart
  • BOOTMGR is missing
  • Press any key to restart
  • Couldn’t find BOOTMGR
  • The Boot configuration Data for your PC is missing or contains errors.
  • File: \Boot\BCD
  • The Windows Boot Configuration Data file is missing required information
  • File: \Boot\BCD

Overview

Solving such problem requires many actions to be taken including following:

  • Fix MBR (master boot record) of main disk
  • Fix PBR (partition boot record) of windows partition
  • Backup BCD Data, Search OS & Create BCD Data

You can use the Startup Repair option in the Windows Recovery Environment from Windows Installation Media to repair the BCD store and correct MBR and PBR. For this you require original Windows Installation Media ISO or DVD.

NOTE:

  • Using Windows Installation Media ensures recovery in case you’ve forgotten to create a system rescue disk and have only original installation ISO or DVD for operating system.
  • It’s not essential to use Windows 7 disk to repair Windows 7 installations. You can use any Windows 7, 8 or 10 media to repair any installation. Not to forgot Easy Recovery Essentials will also be a very powerful tool to Guranteed Repairs as claimed and paid option.
  • Along with that Hiren Boot CD v15.2 provides tools like MBRWizard, MBR Utility, MBRWork, and MBRTool & BootICE.

Nearly a Bullet Proof Process

Here follows a process which will increase OS boot recovery chances to maximum. Follow steps one by one which are based on personal experience as well as this and this website.

Step 1: Apply Startup Repair from Windows DVD or ISO

To do this, follow these steps:

  • Put installation disc of Windows 10 or Windows 8 to recover any Windows 7, 8, or 10 OS. As I’ve observed at times Windows 7 installation media fails to show Repair your computer option.
  • Start the computer, and Press a key when you are prompted to boot from Windows DVD or ISO. Before this if you’re using VMWare Wokstation change boot sequence to DVD then HDD by using Pause Button -> Power On to Firmware option.
  • Select a language, a time, a currency, and a keyboard or another input method on first screen, and then click Next. Don’t click intall now button, Instead click on Repair your computer button in lower left blue window.
  • Once done follow clicking Trobuleshoot -> Advanced Options -> Startup Repair to initiate repair. Restart the computer after removing the disk and check if this works, Good if it works otherwise next step.

Step 2: Apply MBR Repair from Tools on Hiren DVD etc.

To do this, follow these steps:

  • Put installation disc of Hiren v15.2 and Start the computer. Now execute tool BootICE and perform Process MBR and Process PBR. Check if system reboots well, if not next bullet.
  • Put installation disc of Hiren v15.2 and Start the computer. Now execute tool MbrFix and on command prompt use MbrFix.exe /drive 0 fixmbr /yes. Check if system reboots well, if not next bullet.
  • Put installation disc of Hiren v15.2 and Start the computer. Now execute tool MbrFix and on command prompt use MbrFix.exe /drive 0 fixmbr /win7. Check if system reboots well, if not next bullet.
  • You can also try to Fix MBR using tools: Acronis Disk Director, or Partition Wizard. Check if system reboots well, if not next action.

At this stage it’s for sure that system damage is very high and you need to manually rebuild the BCD store

Step 3: Manually Repair the existing BCD store by using Bootrec.exe

To do this, follow these steps:

  • Put installation disc of Windows 10 or Windows 8 to recover any Windows 7, 8, or 10 OS. As I’ve observed at times Windows 7 installation media fails to show Repair your computer option.
  • Start the computer, and Press a key when you are prompted to boot from Windows DVD or ISO. Before this if you’re using VMWare Wokstation change boot sequence to DVD then HDD by using Pause Button -> Power On to Firmware option.
  • Select a language, a time, a currency, and a keyboard or another input method on first screen, and then click Next. Don’t click intall now button, Instead click on Repair your computer button in lower left blue window.
  • Once done follow clicking Trobuleshoot -> Advanced Options -> Command Prompt to open Windows Rescue Command Prompt.
  • Determine the partition where \boot\bcd file is located. Notice that the boot\BCD file may not be on the C: partition but on a separate system partition. In my case it was availaible on C:\boot folder.
  • Backup BCD, Rebuild BCD, FixBoot and FixMBR as follows:
    • Bcdedit /export c:\bcd_backup to backup by export existing bcd data to c:\bcd_backup.
    • Use ren c:\boot\bcd bcd.old to rename corrupted bcd to bcd.old file.
    • If bcd file is not there Step 4 can be followed
    • Use Bootrec /scanos to search for OS, then Bootrec /rebuildbcd to rebuild bcd. Press A to add.
    • Use bcdedit /enum all to verify contents of BCD configuration, should show windows path things like {bootmgr} etc.
    • Navigate to parition of Windows in command prompt using CD prompt. Use Bootrec /fixmbr then Bootrec /fixboot to fix them
    • Close command prompt by pressing [X] button and then click Continue button to proceed.
    • Restart the computer after removing the disk and check if this works, Good if it works otherwise next step.

Step 3: Manually Rebuild the BCD store by using Bcdedit.exe

To do this, follow these steps:

  • Put installation disc of Windows 10 or Windows 8 to recover any Windows 7, 8, or 10 OS. As I’ve observed at times Windows 7 installation media fails to show Repair your computer option.
  • Start the computer, and Press a key when you are prompted to boot from Windows DVD or ISO. Before this if you’re using VMWare Wokstation change boot sequence to DVD then HDD by using Pause Button -> Power On to Firmware option.
  • Select a language, a time, a currency, and a keyboard or another input method on first screen, and then click Next. Don’t click intall now button, Instead click on Repair your computer button in lower left blue window.
  • Once done follow clicking Trobuleshoot -> Advanced Options -> Command Prompt to open Windows Rescue Command Prompt.
  • Use cd /d Partition:\Windows\System32 to move to windows installation Partition:. Type the command bcdedit /enum all and note the GUID that is listed for resumeobject. You will use this GUID later.
  • Type the command bcdedit -create {bootmgr} -d "My Windows OS Description Here" then type bcdedit /displayorder {GUID} where {GUID} is once obtained from previous command. Thereafter use bcdedit /default {GUID} then bcdedit /timeout 30.
  • Close command prompt by pressing [X] button and then click Continue button to proceed.
  • Restart the computer after removing the disk and check if this works, Good if it works otherwise tell me what else can be done :).

System Repair Commands

At time we may like to repair system files using sfc command or perform a system image repair using dsim command. Here, are quick instructions to perform the same.

Note:

It’s important to note that you’ll be making changes to your computer during repair which itself may break your system, as such it’s recommended to do a full backup or create a system restore point in case things go wrong, and you need to rollback the changes before attempting any fix. Also make sure to extract your windows installation disc iso in some folder for use by these tools.

SFC (System File Checker) Command

The sfc command is a Command Prompt command that can be used to verify and replace important Windows system files. System File Checker is a very useful tool to use when you suspect issues with protected Windows files, like many DLL files, and you want to check them and if possible repair these files. Syntax of sfc command is as follows:

Microsoft (R) Windows (R) Resource Checker Version 6.0
Copyright (C) Microsoft Corporation. All rights reserved.

Scans the integrity of all protected system files and replaces incorrect versions with
correct Microsoft versions.

SFC [/SCANNOW] [/VERIFYONLY] [/SCANFILE=<file>] [/VERIFYFILE=<file>]
    [/OFFWINDIR=<offline windows directory> /OFFBOOTDIR=<offline boot directory>]

/SCANNOW        Scans integrity of all protected system files and repairs files with
                problems when possible.
/VERIFYONLY     Scans integrity of all protected system files. No repair operation is
                performed.
/SCANFILE       Scans integrity of the referenced file, repairs file if problems are
                identified. Specify full path <file>
/VERIFYFILE     Verifies the integrity of the file with full path <file>.  No repair
                operation is performed.
/OFFBOOTDIR     For offline repair specify the location of the offline boot directory
/OFFWINDIR      For offline repair specify the location of the offline windows directory

e.g.

        sfc /SCANNOW
        sfc /VERIFYFILE=c:\windows\system32\kernel32.dll
        sfc /SCANFILE=d:\windows\system32\kernel32.dll /OFFBOOTDIR=d:\ /OFFWINDIR=d:\windows
        sfc /VERIFYONLY

Or, more specifically, this is what it looks like with options:

sfc [/scannow] [/verifyonly] [/scanfile=file] [/verifyfile=file] [/offbootdir=boot] [/offwindir=win] [/?]

Important Command Switches Are As Follows:

  • /scannow = This option instructs sfc to scan all protected operating system files and repair as necessary.
  • /verifyonly = This sfc command option is the same as /scannow but without repairing.
  • /scanfile=file = This sfc option is the same as /scannow but the scan and repair is only for the specified file.
  • /offbootdir=boot = Used with /offwindir, this sfc option is used to define the boot directory (boot) when using sfc from outside of Windows.
  • /offwindir=win = This sfc option is used with /offbootdir to define the Windows directory (win) when using sfc offline.
  • /? = Use the help switch with the sfc command to show detailed help about the command’s several options.

Most Useful Syntax for SFC Command

  • sfc /scannow to scan and fix windows system files.
  • sfc /scanfile=c:\windows\system32\ieframe.dll to scan and fix only ieframe.dll file.
  • sfc /verifyonly to just verfiy and report issues in system files.

DISM (Deployment Image Servicing and Management tool) Command

The dism command is a Command Prompt command that can be used to verify and replace important Windows system image files. You may like to see How to repair a Windows 10 Image with DISM later on. Syntax of dism command is as follows:

Deployment Image Servicing and Management tool
Version: 10.0.14393.0


DISM.exe [dism_options] {Imaging_command} [<Imaging_arguments>]
DISM.exe {/Image:<path_to_offline_image> | /Online} [dism_options]
         {servicing_command} [<servicing_arguments>]

DESCRIPTION:

  DISM enumerates, installs, uninstalls, configures, and updates features
  and packages in Windows images. The commands that are available depend
  on the image being serviced and whether the image is offline or running.

GENERIC IMAGING COMMANDS:

  /Split-Image            - Splits an existing .wim or .ffu file into multiple
                            read-only split WIM/FFU files.
  /Apply-Image            - Applies an image.
  /Get-MountedImageInfo   - Displays information about mounted WIM and VHD
                            images.
  /Get-ImageInfo          - Displays information about images in a WIM or VHD
                            file.
  /Commit-Image           - Saves changes to a mounted WIM or VHD image.
  /Unmount-Image          - Unmounts a mounted WIM or VHD image.
  /Mount-Image            - Mounts an image from a WIM or VHD file.
  /Remount-Image          - Recovers an orphaned image mount directory.
  /Cleanup-Mountpoints    - Deletes resources associated with corrupted
                            mounted images.
WIM COMMANDS:

  /Apply-CustomDataImage  - Dehydrates files contained in the custom data image.
  /Capture-CustomImage    - Captures customizations into a delta WIM file on a
                            WIMBoot system. Captured directories include all
                            subfolders and data.
  /Get-WIMBootEntry       - Displays WIMBoot configuration entries for the
                            specified disk volume.
  /Update-WIMBootEntry    - Updates WIMBoot configuration entry for the
                            specified disk volume.
  /List-Image             - Displays a list of the files and folders in a
                            specified image.
  /Delete-Image           - Deletes the specified volume image from a WIM file
                            that has multiple volume images.
  /Export-Image           - Exports a copy of the specified image to another
                            file.
  /Append-Image           - Adds another image to a WIM file.
  /Capture-Image          - Captures an image of a drive into a new WIM file.
                            Captured directories include all subfolders and
                            data.
  /Get-MountedWimInfo     - Displays information about mounted WIM images.
  /Get-WimInfo            - Displays information about images in a WIM file.
  /Commit-Wim             - Saves changes to a mounted WIM image.
  /Unmount-Wim            - Unmounts a mounted WIM image.
  /Mount-Wim              - Mounts an image from a WIM file.
  /Remount-Wim            - Recovers an orphaned WIM mount directory.
  /Cleanup-Wim            - Deletes resources associated with mounted WIM
                            images that are corrupted.

IMAGE SPECIFICATIONS:

  /Online                 - Targets the running operating system.
  /Image                  - Specifies the path to the root directory of an
                            offline Windows image.

DISM OPTIONS:

  /English                - Displays command line output in English.
  /Format                 - Specifies the report output format.
  /WinDir                 - Specifies the path to the Windows directory.
  /SysDriveDir            - Specifies the path to the system-loader file named
                            BootMgr.
  /LogPath                - Specifies the logfile path.
  /LogLevel               - Specifies the output level shown in the log (1-4).
  /NoRestart              - Suppresses automatic reboots and reboot prompts.
  /Quiet                  - Suppresses all output except for error messages.
  /ScratchDir             - Specifies the path to a scratch directory.

For more information about these DISM options and their arguments, specify an
option immediately before /?.

  Examples:
    DISM.exe /Mount-Wim /?
    DISM.exe /ScratchDir /?
    DISM.exe /Image:C:\test\offline /?
    DISM.exe /Online /?

Most Useful Syntax for DISM Command

  • DISM /Online /Cleanup-Image /CheckHealth to verify whether any corruption has been detected without any repairs.
  • DISM /Online /Cleanup-Image /ScanHealth to scan the Windows image for any corruption. Unlike CheckHealth, ScanHealth will take more time.
  • DISM /Online /Cleanup-Image /RestoreHealth to scan the Windows image for any corruption and to perform a repair automatically. Unlike ScanHealth, RestoreHealth will take more time.
  • DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:repairSource\install.wim:1 /LimitAccess to use install.win approach. Here repairSource is location of windows setup file install.win thus a working command could be DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\Sources\install.wim:1 /LimitAccess. Before you can use the repair commands, you will either need a Windows 10 installation media, or the Windows 10 ISO file. It’s also very important that the source of the known good files matches the same version, edition, and language of the operating system you’re using. If we’ve
  • DISM /Online /Cleanup-Image /RestoreHealth /Source:esd:C:\$Windows.~BT\Sources\Install.esd:1 /LimitAccess to use Install.esd approach. Typically Windows 10 during online OS update downloads Install.esd in path C:\$Windows.~BT\ which should be used in case its present in your system after online update and if present.

Note:

  1. While the running DISM using the /RestoreHealth or /ScanHealth, you will notice the process will seem stuck at 20% or 40%, but it’s normal behavior. After a few minutes, the operation will finish as expected.
  2. The Deployment Image Servicing and Management (DISM) utility will always create a log file at %windir%/Logs/CBS/CBS.log capturing any problems the command-line utility fixed or found.