Note details

How to Repair Windows 11 – CMD Trick for Advanced Troubleshooting

BY 3jdyv
June 16, 2025
Public
Private
726 views

Guide to Repair Windows 11 using Command Line Tool in Recovery Mode

Welcome to AA Technical. If you are experiencing issues with Windows 11, this guide provides a step-by-step method to troubleshoot and repair your PC using a command line tool in Windows Recovery Mode, ensuring you don't lose any data.

Preparation

  1. Windows Installation Media:

    • Prepare a bootable USB or DVD with Windows installation files.
    • If you don't have media, create it using the Windows Media Creation Tool from the Microsoft website.
  2. Connect Media:

    • Connect the bootable media to your PC.

Booting into Recovery Mode

  1. Restart and Access Recovery Mode:

    • Restart your PC and press keys like F8, F1, or Shift + Restart from the Start menu to enter the Windows Recovery Environment.
  2. BIOS Boot Manager:

    • If necessary, access BIOS Boot Manager and select the Windows installation media to boot from.
  3. Language Preference:

    • Choose your language preference and click "Next".
  4. Install and Repair:

    • Select "Repair your computer" at the install now screen.

Recovery Mode Actions

  1. Troubleshoot and Command Prompt:

    • In Recovery Mode, select "Troubleshoot" then "Advanced option" and open "Command Prompt".
  2. Identify Drive Letter:

    • Type diskpart and press Enter, then list vol to display all drives.
    • Note the drive letter for your USB or DVD (e.g., G).
  3. Locate Installation Files:

    • Exit diskpart by typing exit.
    • Type dir G:\sources (replace G with your drive letter) to confirm the presence of install.wim or install.esd.

Repair System Using DISM Command

  1. Run DISM:

    • Depending on your file type, run DISM to repair the Windows image using installation media as the source.
    • Use command:
      dism /image:C:\ /cleanup-image /restorehealth /source:G:\sources\install.wim /limitaccess
      
    • Replace C and G with your specific system and media drive letters.
  2. Specify Scratch Directories (if needed):

    • Avoid overloading the system drive by specifying scratch directories:
      dism /image:C:\ /cleanup-image /restorehealth /source:G:\sources\install.wim /scratchdir:G:\ /limitaccess
      
  3. Handling Errors:

    • Double-check paths if you receive errors like "Source files could not be found."
    • Verify drive letters and media integrity.

Final Steps

  1. System File Checker (SFC):

    • Run SFC to ensure all system files are repaired:
      sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
      
  2. Restart PC:

    • Exit Command Prompt and restart your PC.

Your Windows system should now be successfully repaired and functioning normally.

Conclusion

  • If you have questions, feel free to ask.
  • Please like, comment, share, and subscribe to support our channel.

Thank you for watching, and have a nice day!

    How to Repair Windows 11 – CMD Trick for Advanced Troubleshooting