Windows slowing down, crashing, showing errors, or refusing to update? Before you reset or reinstall, run these commands. In this complete Windows repair guide I walk you through every essential diagnostic and repair command built into Windows — from updating all your software automatically with winget, through system file repair with SFC and DISM, disk health with CHKDSK, network stack reset with Netsh, DNS flushing, power diagnostics, battery health reporting, and RAM testing. All commands are listed in the description for easy copy-paste.
Alright, your Windows is slowing down, apps are crashing, updates are failing, you're
getting random errors, and you have no idea where they're coming from.
Before you consider resetting or reinstalling Windows, run these commands.
We're running all of these from Command Prompt or PowerShell with administrator privileges.
Let's open that first.
Click the search bar, type CMD, right-click Command Prompt, and select Run as Administrator.
Click Yes.
Keep this window open, we'll be using it throughout the entire video.
The first command isn't a repair tool, it's a prevention tool, and it belongs at the top
of every maintenance session.
Type winget upgrade dash dash all.
Press Enter.
Winget is Windows' built-in package manager, and this single command scans every application
installed on your system and upgrades all of them to their latest versions simultaneously.
Browsers, media players, development tools, utilities, everything registered with the
package manager.
Outdated software is one of the most common sources of compatibility issues, security
vulnerabilities, and performance problems.
Running this command regularly means your entire software ecosystem stays current without
visiting individual websites or clicking through update prompts one by one.
If you want to review what will be updated before committing, run winget upgrade without
the dash all flag first.
It shows the full list of available updates, so you can decide what to include.
Add include unknown to catch additional apps that Winget can identify, but doesn't upgrade
by default.
Run this command monthly at minimum.
It takes a few minutes and eliminates an entire category of software-related problems.
Command 2 is CHKDSK, check disk, which scans your storage drive for file system errors
and physical bad sectors.
Start with a basic scan to see if any issues exist.
CHKDSK.
Press Enter.
This runs a read-only scan of your default drive and reports what it finds without making
any changes.
For a full repair, we have two options.
CHKDSK slash F. The F flag stands for fix.
It repairs file system errors and directory inconsistencies, ensuring the logical structure
of the drive is intact.
CHKDSK slash R. The R flag stands for repair.
This is the more thorough option.
It scans for physical bad sectors, locations on the drive that can no longer reliably store
data, attempts to recover any readable data from them, and automatically runs the F fix
as part of the process.
My recommendation, run CHKDSK slash R. It includes everything F does and goes deeper.
Type CHKDSK colon slash R. Press Enter.
Because the C drive is in active use by Windows, the scan can't run while the OS is loaded.
Type Y and press Enter to schedule it for the next restart.
Then restart your PC.
Windows will run the full CHKDSK scan before loading, display its findings, and then continue
booting normally.
This is the command to run when files are corrupting unexpectedly, the system is crashing
randomly, or a drive has taken a physical impact.
Command 3 is SFC, System File Checker.
This tool scans every protected Windows system file and compares it against a known good
reference copy.
If it finds corruption or unauthorized modification, it automatically replaces the affected file
from a cached backup.
Type SFC slash Scan Now.
Press Enter.
The scan runs and displays a progress percentage.
Give it 10 to 15 minutes to complete.
When it finishes, you'll see one of three results.
Windows Resource Protection did not find any integrity violations.
Your system files are clean.
Windows Resource Protection found corrupt files and successfully repaired them.
Corruption was found and fixed.
Restart and run the scan again to confirm everything is clean.
Windows Resource Protection found corrupt files but was unable to fix some of them.
This is where the next command becomes essential.
Regardless of the result, restart your PC before moving to the next step.
This ensures any repaired files are properly loaded.
Command 4 works hand-in-hand with SFC and addresses a deeper layer of Windows corruption.
The DISM command, which stands for Deployment, Image, Servicing, and Management.
When SFC fails to fix files, it's often because the component store, the repository of known
good files that SFC uses as its reference, is itself corrupted.
DISM repairs the component store by downloading fresh, verified copies of system components
directly from Microsoft servers.
Type the following command exactly.
DISM slash online slash clean-up hyphen image slash restore health.
Press Enter.
DISM connects to Windows Update, downloads what it needs, and repairs the component store.
This requires an active internet connection and can take 15 to 20 minutes depending on
your connection speed and how much needs to be repaired.
When it completes, you should see a message stating the operation completed successfully.
Now restart your PC again.
After restarting, run SFC one more time.
SFC slash scan now.
This is the critical two-step sequence.
DISM repairs the component store, then SFC uses that now clean store to fix any remaining
system files.
Running them in this order, DISM first, then SFC, is significantly more effective than
running SFC alone.
Your goal is to see Windows Resource Protection did not find any integrity violations after
this second SFC run.
That's your clean bill of health.
Two additional DISM commands worth knowing.
These are diagnostic tools that check the health of your Windows image without making
changes.
DISM slash online slash cleanup image slash scan health.
This performs a thorough scan of the Windows image and reports whether corruption is detected.
It takes longer than check health but is more comprehensive.
DISM slash online slash cleanup image slash check health.
This is a quick check that reads the corruption flag from the component store.
It doesn't perform a full scan but gives you an immediate answer about whether the
image has been flagged as corrupted.
Use check health for a quick status check.
Use scan health when you want a thorough assessment before deciding whether to run restore health.
Use restore health when you need to actually fix detected issues.
Command 6 addresses one of the most frustrating categories of Windows problems.
Network issues that appear without explanation.
You're connected to Wi-Fi but websites won't load.
Certain apps can't reach the internet.
Downloads fail randomly.
The connection seems fine but nothing works properly.
The culprit is often a corrupted Winsock catalog, the Windows component that manages network
communication between applications and the network stack.
Type netsh winsock reset.
Press enter.
You'll see a confirmation that the Winsock catalog has been reset successfully and that
a restart is required.
Also run these other two commands while you're here.
netsh int ip reset.
This resets the TCP IP stack to its default state, useful when IP configuration has become
corrupted.
netsh int tcp reset.
This resets TCP connection settings specifically.
After running all three, restart your PC.
In many cases, this resolves network issues that persisted through driver reinstalls and
router reboots.
Command 7 is quick but solves a specific and common problem, DNS cache corruption.
Your PC maintains a local cache of DNS lookups, a list of website addresses and their corresponding
IP addresses to speed up repeated visits.
When entries in this cache become stale or corrupted, websites fail to load, redirect
incorrectly or behave inconsistently.
Type ipconfig slash flushdns.
Press enter.
You'll see confirmation that the DNS resolver cache was successfully flushed.
Your PC will now request fresh DNS information for every website, bypassing any stale cached
entries.
While you're at it, run these two additional ipconfig commands for a full network refresh.
ipconfig slash release releases your current IP address assignment.
ipconfig slash renew requests a fresh IP address from your router.
This sequence, flushdns, release, renew is the standard first response to connected but
not working internet issues.
Command 8 is less commonly known but useful in specific situations, particularly on machines
connected to a domain network or when DNS name resolution is failing for your own machine.
Type ipconfig slash registerdns.
Press enter.
This command refreshes all DHCP leases and re-registers DNS names in the DNS database.
On home networks it has minimal effect, but on corporate or domain-joined networks it
can resolve issues where the machine's host name isn't resolving correctly or where domain
authentication is failing due to DNS problems.
Command 9 resets the Windows Firewall to its default factory configuration, useful when
firewall rules have been corrupted, misconfigured, or when software has made firewall changes
that are causing connectivity problems.
Type netsh advfirewall reset.
Press enter.
The firewall configuration will be completely reset.
All custom rules, including any added by applications or manually configured, will be removed and
replaced with Windows default firewall policy.
Use this command cautiously.
If you have specific firewall rules configured for business applications or security tools,
note them down before resetting.
After the reset, you'll need to re-add any custom rules that your applications require.
Command 10 generates a detailed power efficiency diagnostic report, particularly useful for
laptop users experiencing battery drain, unexpected shutdowns, or power management issues.
Type powercfg space slash energy.
Press enter.
Windows will monitor your system for 60 seconds and then generate an HTML report saved to
your Windows directory, usually c colon slash windows slash system32 slash energy hyphen
report dot html.
The command output will tell you the exact file path.
Copy that path, paste it into your browser, and the report opens.
It lists energy efficiency errors, warnings, and informational items, covering things like
devices preventing sleep, power policy misconfigurations, battery capacity versus design capacity, and
USB devices causing unnecessary wake events.
This report helps diagnose why a laptop battery drains faster than expected, or why a PC won't
properly enter sleep mode.
Command 11 is one we covered in detail in an earlier video, the battery health report.
Type powercfg slash battery report.
Press enter.
Windows generates a comprehensive battery report saved as an HTML file.
Open it in your browser to see your battery's design capacity versus current full charge
capacity.
This gives you the degradation percentage, along with weeks of charge history, cycle
counts, and estimated runtime.
For any laptop user, this is the definitive tool for understanding battery health.
If your battery is showing significant degradation, below 75% of design capacity, it's time to
consider a replacement.
Before we wrap up, here's a bonus tool that doesn't use CMD, but belongs in any Windows
repair toolkit, the Windows Memory Diagnostic.
Faulty RAM is a surprisingly common cause of system instability.
Random crashes, blue screens, application errors, and performance degradation can all
stem from RAM issues rather than software problems.
Windows has a built-in RAM tester that most people never know exists.
Click the search bar and type mdsch, short for Memory Diagnostic Scheduler.
Open it.
You'll see two options, Restart Now and Check for Problems, runs the test immediately on
the next boot, or Check for Problems the next time I start my computer, schedules it for
a convenient future restart.
Choose your preferred option.
On the next boot, before Windows loads, the Memory Diagnostic will run a thorough test
of every RAM module in your system and report any errors found.
If errors are detected, the culprit is your RAM hardware, not Windows itself, and replacement
is the solution.
If you run through all of these and still have a persistent issue, drop it in the comments
with as much detail as you can.
A like and a subscribe helps the channel grow, and I post practical Windows repair guides
every day.
Thanks for watching.