Run These 9 CMD Commands Now to Repair Windows in Minutes

Brief Summary

This video provides a comprehensive guide to using built-in Windows commands to troubleshoot and fix common PC issues. It covers updating apps, checking system files, repairing hard drives, resolving network problems, assessing drive health, managing processes, and analysing power consumption. Additionally, it highlights the importance of testing RAM for errors.

  • Using command prompt with admin access to fix common PC issues.
  • Nine commands are built right into Windows that can fix most of the issues.
  • Includes bonus tip about Windows memory diagnostic tool.

Introduction

Instead of reinstalling Windows, paying for repair apps, or taking your PC to a shop, the video suggests using built-in Windows commands to fix common issues like freezing, crashing, or losing internet connection. These nine commands, accessible via the command prompt with administrator access, can resolve many problems. The video provides a step-by-step guide on how to access the command prompt as an administrator.

Winget Upgrade --all: Updating Apps

The first command, winget upgrade --all, updates all installed apps on your PC. Winget is Microsoft's built-in package manager, and this command identifies and updates every app with a newer version available, including browsers, media players, and drivers. Updating apps can resolve many issues caused by outdated software. To see what updates are available before running the command, use winget upgrade. Regularly updating apps can prevent future problems.

SFC /scannow: System File Checker

The second command, sfc /scannow, initiates the System File Checker. This tool scans all protected Windows system files, comparing them to clean reference copies and replacing any corrupted or altered files. After the scan, one of three messages will appear: no issues found, problems found and fixed (in which case, restart and rerun the scan), or problems found but not fully fixed. If the last message appears, the next command addresses this situation. Restart your PC after running this command.

DISM /Online /Cleanup-Image /RestoreHealth: Deployment Image Servicing and Management

The third command, DISM /Online /Cleanup-Image /RestoreHealth, complements the sfc /scannow command. DISM (Deployment Image Servicing and Management) operates at a deeper level, fixing the reference store from which SFC pulls clean copies. It connects to Microsoft servers to download fresh, verified system components. An active internet connection is required, and the process can take 15-20 minutes. After completion, restart the PC and rerun sfc /scannow. Using DISM before SFC enhances the effectiveness of system file repair.

CHKDSK /r: Check Disk

The fourth command, CHKDSK /r, or Check Disk, scans the hard drive for file system errors and physical bad sectors. The /r flag performs a deep scan, locating bad sectors, salvaging readable data, and fixing file system issues. Since the C drive is in use, the scan will be scheduled for the next restart. Type Y or Yes when prompted and reboot the PC to run the scan before Windows loads.

ipconfig /flushdns, /release, /renew: DNS Resolver Cache

The fifth command addresses internet connectivity issues. The command ipconfig /flushdns clears the DNS resolver cache, which stores website addresses for faster loading. Stale or broken entries in this cache can cause websites to load incorrectly or not at all. Following this, ipconfig /release drops the current IP address, and ipconfig /renew obtains a new one from the router. This combination of commands (flush, release, renew) often resolves internet connection problems without needing to restart the router.

netsh winsock reset, netsh int ip reset, netsh int tcp reset: Resetting Network Settings

The sixth command goes deeper into network troubleshooting. If the previous commands didn't fix the network issue, the problem might be in the Windows networking stack. The command netsh winsock reset resets the WinSock catalog, which manages communication between apps and the network. Additionally, netsh int ip reset resets the TCP/IP stack to its default settings, and netsh int tcp reset specifically resets TCP connection settings. A PC restart is required after running these commands for the changes to take effect.

PowerShell "Get-PhysicalDisk | Format-Table": Checking Drive Health

The seventh command checks the health of the hard drive or SSD. Instead of the outdated wmic command, the video uses PowerShell. The command powershell "Get-PhysicalDisk | Format-Table FriendlyName, MediaType, Comm, HealthStatus, OperationalStatus" run from the command prompt, retrieves a status report from the drive, indicating its health. If the report shows anything other than "Healthy", it's crucial to back up data immediately as the drive may be failing.

tasklist and taskkill: Managing Processes

The eighth command helps identify and terminate resource-hogging processes. The command tasklist displays a list of all running processes with their process ID (PID) and memory usage. If a suspicious or frozen app is consuming excessive resources, note its PID. Then, use taskkill /PID [PID number] /f to force-close the process. Alternatively, taskkill /im [process name] can be used to kill a process by its name.

powercfg /energy: Analysing Power Consumption

The ninth command is particularly useful for laptop users and those experiencing unusual power drain. The command powercfg /energy monitors the system for 60 seconds and generates a detailed HTML report, saved to C:\WINDOWS\system32\energy-report.html (the exact path will be shown in the command output). This report identifies energy-related issues, such as devices preventing sleep mode, USB devices waking the system, misconfigured power policies, and problematic drivers.

Windows Memory Diagnostic: Testing RAM

As a bonus, the video recommends the Windows Memory Diagnostic tool for identifying faulty RAM. This tool can be accessed by searching for "mdsched" in the search bar. The diagnostic performs a full scan of all RAM modules and reports any errors. If errors are found, the faulty RAM stick needs to be replaced.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the App Store
Get it on Google Play

Transcript

YouTube Transcript Generator

0:00 [music] If your PC has been throwing error at you, freezing, crashing, losing internet for no reason, or just generally acting like it hates you, stop. Don't install Windows. Don't pay for some random repair app you saw in an ad. And don't take it to a shop. Open command prompt instead. There are nine commands built right into Windows that can fix most of this stuff on their own. And I'm going to walk you through every single one. Every command coming up needs administrator access just to let you know. So let's open command prompt the right way. Hit the search bar in your taskbar. Type cmd and once you see command prompt in the results, right click on it and choose run as administrator. [music] Hit yes on the permission prompt. Don't close this window after each prompt.

0:47 We'll be running everything from this same one. So first command and honestly the one I would run before anything else. In the window type windget upgrade d-all and press enter. Winget is the package manager with Microsoft baked into Windows. And what this single line does is hunt down every installed app on your machine that has a newer version available and update all of them in one shot. browsers, media players, drivers registered with the manager, productivity tools, the lot, a massive chunk of the random problems people blame on Windows itself are actually just outdated apps fighting with each other. Knocking them all down at once eliminates that whole category of issues

1:32 before you even start troubleshooting. If you'd rather see what's about to update before pulling the trigger, just type wing upgrade on its own first and you'll get a full list. Make this a habit once a month and your PC will definitely thank you. The second command is sfc/can. Now sfc stands for system file checker and what it does is sweep through every protected Windows system file on your drive. Compare each one against a clean reference copy and replace anything that looks corrupted or tempered with. Type sfc space slashcan now and press enter. The scan kicks off and shows you a progress percentage as it works through the files. When it finishes, you'll get one of three messages. Either it found

2:19 nothing wrong, which means your system files are clean. It found problems and fixed them, in which case restart, run it again, and confirm, or it found problems and couldn't fix some of them, which is the message you don't want to see. If that last one shows up, just don't worry. The next command on the list is built specifically to handle exactly that situation. Now restart your PC before moving on. Either way, the third command goes handinhand with the one you just ran. SFC scan. Now it is dism or dm stands for deployment image servicing and management. And it works on a deeper layer than sfc. The reason SFC sometimes fails to repair files is because the reference store it pulls clean copies from can itself be

3:05 corrupted. DM fixes that store by reaching out to Microsoft servers and pulling fresh verify system components straight from the source. Type the following exactly dismis space/online space/cleanup-image space/restorealth and press enter. You'll need an active internet connection for this one and it can take 15 to 20 minutes depending on your speed and how much repair work it has to do. Once it tells you the operation completed successfully, restart your PC and run sfc/scan out one more time. Running these two together in this order, dm first then sfc is way more effective than running sfc alone. The four command is for your actual hard

3:52 drive. CHK DSK, it's short for check disk, scans your storage for two kinds of problems. File system errors, where the directory structure of the drive has gotten out of whack, and physical bad sectors, which are spots on the drive that can no longer hold data reliably. There are a few versions of this command, but the one I always reach for is chkdsk spas /r. The SLR flag does the deep scan, finds bad sectors, salvages whatever readable data is left in them and then includes the file system fix automatically. Type chkdsk space/r and press enter. Because your C drive is busy running Windows right now, the scan can run live. You'll get a

4:39 prompt asking if you want to schedule it for the next restart. Type why or yes and press enter. Then reboot your PC. Windows runs the full scan before it loads, shows you what it found, and boots normally. The fifth command is the first stop for any internet weirdness. Your PC keeps a local list of websites and their addresses to load pages faster. And when entries on that list go stale or break, sites stop loading or load wrong even though your connection looks fine. Type ipconfig space/flushdns and press enter. You'll see a confirmation that the DNS resolver cache was cleared. From now on, your PC asks for fresh address info every time you visit a site. While we are in here, run

5:24 two more commands that pair perfectly with this one. Type IP config space/re and press enter, which drops your current IP address. Then type IP config space/renew and press enter, which grabs a fresh one from your router. These three combo commands, flush, release, renew, is the move I always run first when somebody tells me their internet is connected but nothing's actually working. Solos a surprising number of those exact issues without touching the router or restarting anything. The six command goes deeper than the last one. If the previous fix didn't sort your network out, the problem is probably sitting in the Windows networking stack itself. There's a piece of the Windows called windock catalog that handles communication between your apps and the network and when it gets corrupted weird

6:11 apps can reach the internet downloads die randomly. Certain sites flat out refuse to load. Type netsh space wins space reset and press enter. You'll get a message that the catalog was reset successfully. While you're at it, run these two right after. Type netsh space int space ip space reset and press enter which resets the entire TCP IP stack to factory defaults. Then type netsh space int space TCP space reset and press enter which handles TCP connection settings specifically. After all three of these you absolutely have to restart your PC otherwise none of it actually take effect. This combo fixes a lot of stubborn network problems that survive

6:58 driver reinstalls and router reboots. Seventh command checks something most people never think about until it's too late. The actual health of your hard drive or SSD. Modern drives keep track of their own condition internally and Windows can ask them for a status report. The classic command for this used to be wic but Microsoft has been phasing it out. So, we're using PowerShell instead, which works on every current version of Windows 10 and Windows 11. So, here's the trick. You can run PowerShell commands from inside command prompt without opening a separate window. Type this exactly powershell space quote get dash physical disk pipe format dash table friendly name, media type, comm, health status,

7:44 comma, operational status, quote, and press enter. In a couple of seconds, you'll get back a clean table listing every drive in your PC, what type it is, and whether it's reporting healthy or not. If you see anything other than healthy in that column, start backing up your data immediately because the drive is on its way out. The eighth command is for those moments when your PC is dragging and you have no idea what's chewing up the resources. Task manager is one option, that's sure, but the command line gives you the same information faster and lets you do something about it in the same window. Type task list and press enter. You'll see a long list of every process currently running on your PC along with a process ID number called a P ID in the

8:29 second column. Look for anything you don't recognize that's hogging the memory in the rightmost column. If you spot something suspicious or a frozen app eating resources, write down its P ID. Then type task kill space/p space the number you wrote down. Space slashf and press enter. The slashf flag at the end forces it to close even if it's not responding and boom, gone. You can also kill by name with task kill im space then the process name. Useful when an app refuses to close through normal means. Ninth and final command before the bonus. This one is gold for laptop owners and anyone whose PC seems to drain power weirdly or refuses to sleep

9:15 properly. Type power cfg space/ energy and press enter. Windows watches your system for a full 60 seconds while it does this. So, leave the window alone and don't touch anything. When it finishes, it spits out a detailed HTML report and saves it to C cols back/system32 back/energy-report.html. The command output will tell you the exact path. Copy that path, paste it into the browser address bar, and the report opens up. Inside you'll see a breakdown of every energy related issue on your PC. Things keeping your machine awake when it should be sleeping. USB devices waking up randomly. Power policies that are misconfigured. Drivers

10:01 behaving badly. For laptop users especially, this report is a gold mine for figuring out why your battery is draining faster than it should be. Now for the bonus, and this one isn't actually a CMD command, but it absolutely deserves to be in any Windows repair toolkit. The Windows memory diagnostic. Bad RAM is the silent killer behind a shocking number of weird Windows problems. It random crashes, blue screens, apps closing for no reason, file corrupting out of nowhere. People blame Windows for all of it when the real culprit is a faulty stick of memory. Windows has a built-in tester for this and almost nobody knows about it. Click the search bar, type mds chedd and press enter. A small windows opens up with two options. One is to restart

10:48 now and run test immediately. The other lets you schedule it for the next time you reboot. Pick whichever fits your schedule. On the next boot, before Windows even starts loading, the diagnostic runs a full scan of every RAM module in your system and tells you if anything is broken. If it finds errors, the answer isn't software at all. It's a hardware and you need to replace the bad stick. Now, that's the full list. Drop a comment. Let me know which command saved you the most headache and hit subscribe and if you want more guides like this and I'll see you in the next one.

Share

YouTube Video Summaries