win RE command prompt repair options: attrib c:\boot\bcd -h -r -s || bootrec/rebuild bcd || registry backup repair RRS feed

  • Question

  • When there is a failure to boot there can be many error codes.

    For windows 7 professional using a windows 7 iso > command prompt > Administrator X:\Windows\system32\cmd.exe

    This command can be ran:  sfc /scannow /offbootdir=d:\ /offwindir=d:\windows

    1) how do you determine the applicable drive letter?

    a) would you run bootrec /scanos ?

    b) would you run bcdedit /enum all  ?

    c) would you run bcdedit | find "osdevice"

    d) diskpart > list disk > list volume > dir c: > dir d: > dir e: etc.

    Which of the above can and cannot be run depending on the error message?

    2) if you run the command and it indicates that it found corruption and was not able to fix all of it what are the next options?

    a) don't all of the dism commands fail to work in a windows RE?

    3) There is a command attrib c:\boot/bcd -h -r -s    what do each of the letters mean?  when do you need to use this command?

    4) If the failure to boot windows indicates that a critical file is missing that ends in .sys or ends in .dll does that alter the method for troubleshooting?  

    a) do you specifically look for a replacement file?

    b) if so how would you replace a specific file in the windows RE using command prompt?

    c) if you do not look for the specific file is the error indicating that it is a failure to boot and it needs fixmbr, fixboot, bootrec /rebuild?

    d) or if you do not look for the specific file is the error indicating that it can be solved by a registry backup using command prompt?

    Any references are appreciated so that it becomes clear when to use which troubleshooting steps and how to use them.

    Monday, January 1, 2018 5:51 AM

All replies

  • Hi,

    The C: drive in Windows will often have a different letter in WinRE. You can determine the active system partition using Diskpart command, bootrec /scanos command, bcdedit /enum, bcdedit | find "osdevice" command, please refer to:

    Bootrec tool support the following options:

    /fixbr  /fixboot /scanos /rebuildbcd,

    And attrib bcd -s -h -r means remove the System, Hidden, and ReadOnly attributes of the bcd file. Use the Bootrec.exe tool to troubleshoot a "Bootmgr Is Missing" error. If rebuilding the BCD store doesn't resolve the startup issue, you can export and delete the BCD store and then run this option again. By doing this, you make sure that the BCD store is completely rebuilt. Here is the command:

    bcdedit /export C:\BCD_Backup


    cd boot

    attrib bcd -s -h -r

    ren c:\boot\bcd bcd.old

    bootrec /RebuildBcd

    To troubleshoot a boot up issue, you should firstly use the command to have a full scan

     sfc /scannow /offbootdir=d:\ /offwindir=d:\windows

    Then follow the above reference to determine the active partition and rebuild the bcd store. After that, if is specific a .sys file , you can use the command to fix the specific file or use robocopy command to copy the file from a working machine and export to the problematic machine.

    sfc /scanfile=<path> /offbootdir=d:\ /offwindir=d:\windows

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Tuesday, January 2, 2018 7:29 AM
  • Approximately 3 weeks ago a clean install was performed with a windows 10 iso.

    Using the same windows 10 iso the computer was booted to the windows advanced troubleshooting menu

    command prompt > administrator: x:\windows\system32\cmd.exe > x:\sources>


    bootrec /rebuildbcd

    Scanning all disks for Windows installations.

    Please wait, since this may take a while...

    Successfully scanned Windows installations.

    Total identified Windows installations: 0

    The operation completed successfully.

    1) Please explain the meaning of :  Total identified Windows installation: 0 when the operation completed successfully.  How come it did not display total identified windows installation: 1

    Please explain the meaning when it displays 0 versus 1


    X:\sources>bcdedit /export c:\bcd_backup

    The operation completed successfully.


    c:\>cd boot

    The system cannot find the path specified

    c:\>attrib bcd -s -h -r

    File not found - bcd

    2) How come cd boot displayed that it could not find the path specified?

    3) How come attrib bcd -s -h -r displayed file not found - bcd

    4) c:\>bcdedit /enum

    displayed the partition=c:

    5) So how come after a clean install the total identified windows installations is 0 with system cannot find the path c:\>cd boot and the partition=c: ?

    bootrec /rebuildbcd was typed again and it again displayed total identified windows installation: 0

    c:\>bcdedit /export c:\bcd_backup

    The operation completed successfully

    ren c:\boot\bcd bcd.old

    The system cannot find the file specified.

    6) How come it displayed the system cannot find the file specified?

    cd /d c:\Windows\System32

    bcdedit /enum all

    bcdedit -create {bootmgr} -d "Description"

    For "Description" the information from resumeobject under the windows boot loader was copy and pasted into the command.

    It displayed:  An error occurred while attempting the specified create operation.

    The specified entry already exists.

    Cannot create a file when that file already exists.

    Please explain each of the above command failures.

    Please indicate alternative commands to get the failed commands to work so that commands can be performed to fix a failed boot.

    Wednesday, February 7, 2018 5:38 AM