How to Repair Windows 11 Using Command Prompt: A Step-by-Step Guide

Command Prompt can help repair some Windows 11 problems, but there is no single command that safely “repairs Windows.” The correct tool depends on whether Windows starts normally, system files are damaged, the disk has errors, or the computer cannot boot.

Repair the Windows component store with DISM

If Windows starts, open Terminal or Command Prompt as administrator and run DISM /Online /Cleanup-Image /RestoreHealth. DISM checks the component store that Windows uses for servicing and can obtain replacement components through Windows Update when needed.

Check protected system files with SFC

After DISM completes, run sfc /scannow. System File Checker examines protected Windows files and attempts to replace damaged copies. Restart afterward if Windows reports that repairs were made.

Use CHKDSK only for a disk-related reason

CHKDSK checks a file system; it is not a general Windows repair command. Options that modify a volume can require a restart and can take significant time. Back up important data first, especially if the drive is showing signs of physical failure.

If Windows will not start

Use the Windows Recovery Environment and its supported Startup Repair, uninstall-update, restore, and recovery options. Command-line boot repairs are situation-specific, particularly on modern UEFI/GPT systems, and blindly copying old bootrec command sequences can make diagnosis harder.

Do not run random repair scripts

A batch file or command list from an unknown source can change services, permissions, networking, boot configuration, or security settings. Run only commands whose purpose matches the diagnosed problem.

Protect data before major repair

If Windows remains unstable, back up accessible files before reset, reinstall, partition, or destructive disk operations. A repair command is never a substitute for a current backup.

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy