How to Repair the Windows Bootloader Using CMD
Category: Troubleshooting
If your Windows PC fails to boot correctly, it could be due to a corrupted bootloader. The bootloader is a critical system component responsible for loading the operating system. Fortunately, you can fix boot issues using the Command Prompt (CMD) with a few simple commands. This guide will walk you through the process of repairing the Windows bootloader step by step.
1. Boot from Windows Installation Media
To access CMD when your system won't boot:
- Insert a Windows installation USB or DVD and restart your PC.
- Press the required key (usually
F12
orEsc
) to access the Boot Menu. - Select the installation media and boot from it.
- On the setup screen, click Next and choose Repair your computer.
- Select Troubleshoot > Advanced Options > Command Prompt.
2. Rebuild the Boot Configuration Data (BCD)
The BCD contains boot configuration parameters and controls how the operating system is started.
bootrec /rebuildbcd
If your system finds a Windows installation, press Y to add it to the boot list.
3. Repair the Master Boot Record (MBR)
The MBR contains information about how the logical partitions are organized on the disk.
bootrec /fixmbr
bootrec /fixboot
These commands fix the MBR and write a new boot sector to the system partition.
4. Fix Boot Sector Issues
If the boot sector is corrupted or missing, you can repair it using:
bootsect /nt60 C: /mbr
This command updates the master boot code to be compatible with Windows.
5. Scan for and Fix Corrupted System Files
Running an SFC scan ensures system files are intact and not corrupted.
sfc /scannow
This may take a while, so be patient. Once completed, restart your computer.
6. Check Disk for Errors
Disk errors can also cause boot issues. To check your disk for errors:
chkdsk /f /r C:
This command scans the C: drive for errors and repairs them if found.
7. Reset Boot Configuration
Resetting the boot configuration can help resolve persistent issues.
bcdedit /export C:\bcdbackup
attrib c:\boot\bcd -h -r -s
del c:\boot\bcd
bootrec /rebuildbcd
This process rebuilds the BCD completely from scratch.
8. Restart Your Computer
Type the following command to restart:
shutdown /r
Remove the installation media and let the system boot up to check if the issue is resolved.
Conclusion
Repairing the Windows bootloader using CMD can resolve many startup issues and restore your system to working condition. If none of these methods work, consider performing a clean installation of Windows. Always make sure to back up your data before attempting repairs to minimize data loss risks.
For more troubleshooting guides, visit Microsoft Support.