Skip to content

Windows Fixes

System & Boot

Windows won't boot — repair BCD

Boot from Windows installation media, open Command Prompt:

bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd

DISM / SFC repair

Run in order — SFC first, then DISM if SFC fails to fix issues:

sfc /scannow

DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth

Windows Update stuck or failing

# Stop services, clear cache, restart
Stop-Service wuauserv, cryptSvc, bits, msiserver
Rename-Item C:\Windows\SoftwareDistribution SoftwareDistribution.old
Rename-Item C:\Windows\System32\catroot2 catroot2.old
Start-Service wuauserv, cryptSvc, bits, msiserver

COM Surrogate / DLL host crash loop

regsvr32 /u thumbcache.dll
regsvr32 thumbcache.dll

Group Policy

Force GPO refresh

gpupdate /force

Check applied GPOs and last refresh time

gpresult /r
gpresult /h C:\Temp\gpreport.html

Activation & Licensing

Check activation status

slmgr /xpr      # expiry date / permanent
slmgr /dlv      # detailed license info

Re-activate or change product key

slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /skms kms-server.domain.com
slmgr /ato

Profile & Registry

Fix corrupted user profile — create new and copy data

  1. Log in as a different admin account
  2. Back up C:\Users\brokenuser
  3. Delete the profile:
    net user brokenuser /delete
    net user brokenuser Password123! /add
    net localgroup administrators brokenuser /add
    
  4. Log in as the user once to generate a new profile, then copy data from the backup

Remove a stuck registry key

# Take ownership and delete
$key = "HKLM:\SOFTWARE\Stubborn\Key"
$acl = Get-Acl $key
$acl.SetOwner([System.Security.Principal.NTAccount]"Administrators")
Set-Acl $key $acl
Remove-Item $key -Force -Recurse

Networking

Reset TCP/IP stack

netsh int ip reset
netsh winsock reset
ipconfig /flushdns
ipconfig /release
ipconfig /renew

DNS client not resolving

# Clear and restart DNS client
ipconfig /flushdns
Restart-Service Dnscache

Can't ping by hostname but can by IP

Check:

  1. DNS suffix search list: ipconfig /all → look for "DNS Suffix Search List"
  2. Hosts file: notepad C:\Windows\System32\drivers\etc\hosts
  3. NetBIOS: nbtstat -n

Printing

Clear stuck print queue

Stop-Service spooler
Remove-Item "$env:SystemRoot\System32\spool\PRINTERS\*" -Force
Start-Service spooler