Repair Windows 10 Using Command Prompt

Steps to Repair Windows 10 with Command Prompt

  1. Boot into Windows Recovery Environment (WinRE):

    Insert the bootable USB drive. Restart your computer and boot from the USB. Once the Windows Setup screen appears, select Repair your computer. From the Choose an option screen, navigate to Troubleshoot > Advanced options > Command Prompt.

  2. Open Command Prompt and Start Diskpart:
    diskpart
  3. List and Select Disks:

    To list all disks, type the following:

    list disk

    Select the disk where Windows is installed (usually Disk 0):

    select disk 0
  4. List Volumes:

    List all volumes to identify the Windows partition and the system reserved partition:

    list vol

    Example output:

    Volume 0  C  System Reserved
    Volume 1  E  (Windows Drive)
    Volume 2  D  Pendrive
                    
  5. Reassign Drive Letters:

    Change the drive letter of the system reserved partition:

    select vol 0
    assign letter=g:

    Now assign C as the drive letter for the Windows partition:

    select vol 1
    assign letter=c:
  6. Verify the Changes:

    Check the changes using the following command. The asterisk (*) next to the C: drive indicates it is now the boot drive:

    list vol
  7. Exit Diskpart:
    exit
  8. Repair the Boot:

    Run the following commands to repair the boot:

    bootsect /nt60 all /force
    bcdboot c:\windows /s g: /f ALL

    Note: Here g: represents the system reserved partition.

  9. Fix Boot Records:

    Run the following commands:

    bootrec /fixmbr
    bootrec /fixboot   (May show "Access is denied", but proceed)
    bootrec /RebuildBCD
  10. Exit and Restart:

    After completing the commands, exit Command Prompt and restart your system:

    exit

    Remove the bootable USB drive and restart your computer. Windows should now boot normally.