Command Prompt fixes

Copy-ready CMD repair paths with safety notes.

Use Command Prompt when Windows needs direct repair: system file checks, disk scans, DNS/IP resets, update service reset, and boot recovery.

Laptop repair close-up with tools

Before you run commands

  • Back up important files when Windows still opens.
  • Connect the charger.
  • Use an administrator Command Prompt.
  • Read the note under each command before pressing Enter.

Open admin CMD

  1. Press Start.
  2. Type cmd.
  3. Right-click Command Prompt.
  4. Select Run as administrator.
System repair

Repair corrupted Windows files.

Run DISM first to repair the Windows component store, then SFC to scan protected system files.

DISM then SFC
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow

What good output looks like

DISM should finish with a successful operation message. SFC may report no violations, successful repairs, or files it could not repair.

If SFC cannot fix everything

Restart, run the pair again once, then check the CBS log or request support. Repeated corruption can point to disk, RAM, update, or malware problems.

Disk repair

Check storage without making the problem worse.

Online disk scan first
chkdsk C: /scan
Repair disk errors on next restart
chkdsk C: /f /r

Data warning

If the drive clicks, disappears, shows SMART failure, or contains irreplaceable files, stop and back up or use professional recovery. Heavy disk repair on a failing drive can reduce recovery chances.

Internet repair

Reset DNS, IP, and network stack.

DNS and IP refresh
ipconfig /flushdns
ipconfig /release
ipconfig /renew
Winsock and TCP/IP reset
netsh winsock reset
netsh int ip reset
shutdown /r /t 0

Restart is important after Winsock/TCP/IP reset. If the problem returns, inspect drivers, VPN software, proxy settings, router firmware, and ISP status.

Windows Update

Reset update services after basic repair fails.

Use only after the troubleshooter, restart, DISM, and SFC do not solve the update problem.

Reset Windows Update components
net stop wuauserv
net stop cryptSvc
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old
net start wuauserv
net start cryptSvc
net start bits
net start msiserver
Boot recovery

Use boot repair only from Windows Recovery Environment.

Important

Boot commands can affect startup records. If BitLocker is enabled, confirm the recovery key first. If data is critical, back up before changing boot files.

Legacy/BCD boot repair checklist
bootrec /fixmbr
bootrec /scanos
bootrec /rebuildbcd
UEFI BCD rebuild pattern
diskpart
list volume
select volume <EFI_VOLUME_NUMBER>
assign letter=S:
exit
bcdboot C:\Windows /s S: /f UEFI
GoalCommandUse whenCaution
System filesDISM + sfcWindows feels corrupted, apps crash, update errorsRun as administrator and let scans finish
Diskchkdsk C: /scanDisk warnings or file-system errorsBack up first if drive health is questionable
DNS/IPipconfig /flushdnsWebsites fail, DNS errorsDoes not fix ISP or router outage
Network stacknetsh winsock resetBroken connection after VPN/malware/driver changesRestart required