How to fix the Windows boot loader (MBR) using command prompt

Windows generate an error at boot time and not start? You can solve problems with the startup of the operating system and repair loader functionality using the command line.

Contents

  1. Reasons for boot loader problems
  2. Restore at the boot
  3. Restore Windows boot loader via command prompt
  4. What to do if important data was lost?

Reasons for boot loader problems

Windows boot problems are a clear sign that the files, responsible for booting the OS are corrupted. There are many reasons for starting your system incorrectly.

The most common ones are:

  • Installing additional operating systems that damage the boot files of the primary operating system.
  • Damaging or deleting boot files by malicious programs and viruses.
  • Loss of data due to physical and software failures of the drive.

Restore at the boot

“Broken” or missing files of the OS loader lead to the inability to startand correct the operation of the computer. In this case, you should resort to restoring the Windows loader in the following way:

Step 1: You will need a Windows Recovery CD or bootable flash drive to start recovering the boot. Important: for the recovery system to work correctly, you will need to boot at the same bit (32 or 64-bit) as the current OS. If you boot from the installation disk, you will need to select “Repair your computer” on the installation screen.

Step 2: Select “Troubleshoot” on the recovery screen.

Step 3: In the window that opens, select “Start-up Repair”.

This will be followed by automatic repair and correction of faults that do not allow for normal OS boot up.

Unfortunately, automatic restore methods do not always help to restore the operating system, so sometimes you should resort to manual repair using the command prompt.

Restore Windows boot loader via command prompt

To start recovering the loader using the command prompt, you need to open it first. It can be done using the boot drive or the recovery and diagnostics menu.

If you are using a bootable drive, you must press Sfit+F10 on the language selection screen.

Read more:  What is RAID and Which Type of RAID Should Use

You can access the command prompt via the diagnostics menu by clicking the corresponding icon.

After opening the command prompt, you should enter the following commands:

  • Diskpart (built-in utility for working with hard drives)
  • List volume (list of connected drives)
  • Exit (shutdown of the utility)

Each command must be confirmed with the Enter key.

This procedure will allow you to find out which drive is the system one (by default it is drive C), and based on this knowledge, you will be able to perform program recovery of bootloader files.

You will then need to enter bcdboot c:\windows to fix most bootloader problems.

It should be noted that if there are several operating systems installed on the computer, this method should be done for each system in turn.

If this method did not work, you can clean the bootloader completely and create its files again.

To do this: open the command prompt in any convenient way. Enter diskpart. Then, volume list. After that, we find a hidden partition with the loader (usually it is a 100-500 Mb, disk created by the system by default in FAT32 format) and remember the letter of this partition.

Now you need to enter a series of commands that delete and recreate the loader.

  • Choose volume 3 with the command select volume 3 (instead of 3, there can be another number).
  •  Format the volume with the command format fs=ntfs, or format fs=fat32, depending on the disk file system.
  • Assign the name «Y» to that command assign letter=Y
  • We exit the utility with the exit command.
  • Enter the command bcdboot C:\Windows /s Y: /f ALL (letters C and Y may vary depending on the system and the number of disks). If you have more than one operating system installed, you need to perform this step for all volumes with bootloaders.

At this point, the recovery of the loader can be considered complete.

ТNow you need to delete the assigned volume letter. You can do this by going to the command prompt as follows:

  • Enter the diskpartcommand.
  • Next, you need to display the list of media with the command list volume.
  • Select the volume named Y with the command select volume Y.
  • Remove the name with the command remove letter =Y.
  • Exit.
Read more:  Unreadable Media. Corrupted or Unknown File System?

Now for normal booting of the PC it is enough to reboot the system.

What to do if important data was lost?

Problems with the Windows operating system directly affect the data safety not only on the system drive but also on other local drives and flash drives connected to the computer. For example, if there are problems with the boot loader, the system cannot boot, and constant reboots may lead to failures in the logical structure of other disks.

In addition, users often solve boot loader problems by simply reinstalling Windows to get a clean and fast operating system. But reinstalling the system wipes out all data on the system disc, and often formatting the system disc causes the loss of data that the user has been working on for weeks.

If something similar has happened to you, do not despair prematurely. Use RS Partition Recovery.

RS Partition Recovery

Download RS Partition Recovery

All-in-one data recovery software

It has no problem recovering data lost due to accidental disk formatting, reinstalling of the operating system, damages in the logical structure of the disk, and in many other cases.

RS Partition Recovery is not demanding on your computer resources, which allows you to use it on weak computers and office laptops.

The recovery process is carried out practically in a few mouse clicks due to the built-in file recovery wizard.

Note: It is recommended that the location where the recovered file will be written is different from the location where the file was previously stored. It will allow to avoid overwriting the file.

You can save the recovered file to a different local disk or flash drive, compress into a ZIP-archive or upload to an FTP-server.

Frequently Asked Question

Den Broosen

About Den Broosen

Author and site editor for RecoverySoftware. In his articles, he shares his experience of data recovery on a PC and the safe storage of information on hard drives and RAID arrays.

3Response to How to fix the Windows boot loader (MBR) using command prompt

  1. Fatih says:

    Thnk you so much. I finally opened windows and backup everything.

  2. Joshua says:

    Thanks for this guide! It took a couple of tries, but the process eventually worked and got me back into my PC.

  3. Arun says:

    the first method worked for me. thanks!

Leave a comment