- SFC, DISM, and CHKDSK cover system files, Windows image, and disk, respectively.
- Run DISM in the order CheckHealth > ScanHealth > RestoreHealth if SFC is not enough.
- Program backups and use CMD always with administrator privileges.
- Use netsh, ipconfig, and wmic for quick diagnostics and offline environments.
If Windows starts to stutter, launch exception errors in files or it just hangs up, the Symbol of the system It can get you out of trouble with just a few commands key code. SFC, DISM, and CHKDSK are the three most effective native tools for repairing the system.each with a different objective and a complementary scope.
Before we get down to business, some good news: you can run them manually or from a batch file (.bat) with administrator privileges, and they will work the same on both Windows 10 and [other operating systems]. Windows 11. Create a small script These utilities save you time on maintenance tasks and leaves the team ready without having to go command by command; it can also be coordinated with techniques for a PC automatically starts up.
Essential CMD commands for repairing Windows

When we talk about repairing Windows from the console, there are three undisputed protagonists. SFC checks system files, DISM repairs the Windows image, and CHKDSK checks the disk. looking for errors and defective sectors.
SFC (System File Checker)
The System File Checker scans protected Windows files and replaces corrupted ones with safe cached copies. Its star command is sfc /scannowwhich should be launched on a console with administrator privileges.
To see all available options, run sfc /?. Among the most useful modifiers are:
- / scannow: automatically scans and repairs protected files.
- /verifyonly: only checks, does not repair.
- /scanfile: analyzes and repairs a specific file by indicating its path.
- /verifyfile: checks a specific file without repairing it.
- /offbootdir y /offwindir: for using SFC in offline installations.
- /offlogfile: defines log file when using offline SFC.
Several messages may appear at the end of the analysis. The most common ones are:
- Windows Resource Protection did not find any integrity violations: no damage detected.
- Windows Resource Protection found corrupt files and successfully repaired them: SFC has repaired the corrupt files.
- Windows Resource Protection found corrupt files but was unable to fix some of them: You will need to continue with DISM.
- Windows Resource Protection could not perform the requested operation: Try in Safe Mode or check permissions.
If you need more clues, check the details in %WinDir%\Logs\CBS\CBS.log. This record keeps a complete record of the analysis and repairs., very useful when CFS can't handle everything.
When to use CFS
It is intended for times when you notice that Windows functions stop responding, errors such as "file not found" appear, or system applications fail to open. When the problem is minor or affects system components, SFC is usually the first step.
DISM (Deployment Image Servicing and Management)
DISM works on the Windows image, which is the basis of the entire system. It is used to inspect, clean and repair damaged components of the imageespecially when SFC fails to fix it.
The recommended order of execution is clear: DISM /Online /Cleanup-Image /CheckHealth, then /ScanHealth & AFTER /RestoreHealth. It is important to respect that order and wait for each phase to finish. before moving on to the next one.
Si Windows Update If it doesn't work or there's no connection, you can specify a local source with /Source and avoid online downloading with /LimitAccess, For example: DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\Windows /LimitAccess. This mode is ideal when you use an installation medium as a clean source..
When to use DISM
Use DISM when updates fail, blue screens or messages related to the "component store" or system stability appear, or when SFC is unable to repair certain files. DISM is the “second step” to repair more serious problems that affect the image of Windows.
CHKDSK (Check Disk)
CHKDSK analyzes the file system structure and the physical state of the drive. With chkdsk C: /f /r You ask to correct logical errors and search for bad sectors Recovering readable data.
If the drive is in use (for example, C:), the system will propose to run the check on the next restart. Accept it and don't interrupt the process to avoid further corruption.
To NTFS There are advanced modifiers such as /scan (online analysis), /forceofflinefix (along with /scan skips online repairs), /perf (more resources to speed up scanning), /spotfix (specific correction) or /sdcleanup (cleaning of safety descriptors). Use them wisely depending on the scenario.
When to use CHKDSK
If your PC takes a long time to start up, you notice frequent freezes or blue screens such as 0x00000017 errorIf you suspect read/write errors, it's advisable to run it. CHKDSK resolves logical file system errors and maps bad sectorswhich may be the origin of the symptoms.
Incidentally, there is a 3-stage review: basic file system structure, name links, and security descriptors. At the end you will see a summary of corrected errors and findingsuseful for deciding next steps.
Differences in approach
To avoid confusion: SFC repairs protected Windows files, DISM repairs the system image, and CHKDSK acts on the disk and file system. They don't do the same thing, but they complement each other. and it's important to be clear about when to use each one.
As a quick guide: Start by running SFC if the problem seems "Windows-related".If there's no progress, move on to DISM; if you suspect a disk or partition issue, run CHKDSK. In stubborn cases, all three together in the correct order.
When and how to run each tool
Before typing anything, organize your attack plan well. A couple of preparations will save you from surprises and wasted time..
Essential preparations
1) Backups. Save your documents and photos on an external drive or cloud storage. Although SFC, DISM, and CHKDSK do not erase personal data by designDuring disk repairs, information could be lost in unrecoverable sectors.
2) Console with permissions. Open “Command Prompt” by right-clicking and selecting “Run as administrator”. Without elevation, some commands won't even start. and you'll see permission errors.
3) Close applications. This prevents interference during scanning and repairs. The fewer open processes, the fewer file locks..
Run SFC correctly
In CMD as admin, type sfc /scannow and wait. Don't cancel even if it seems to be "stuck"On slow systems, this may take a while. If it can't fix everything, check the CBS log and continue with DISM.
Run DISM in the correct order
In CMD as admin, then launch the following: DISM /Online /Cleanup-Image /CheckHealth, then /ScanHealth and finally /RestoreHealth. An internet connection helps because DISM will pull Windows Update (which may return errors such as 0 x 8019001) To download clean components. Without internet, use /Source with an installation medium and add /LimitAccess.
Run CHKDSK with the key options
In CMD as admin: chkdsk C: /f /r. If it asks to schedule it upon restart, accept.For rapid, on-the-fly diagnostics, chkdsk C: /scan It's also useful, and you can add /perf to accelerate on powerful computers.
Typical symptoms for each command
- SFC: system functions that are not responding, apps Windows crashes, “file not found” messages.
- DISM: update errors, image corruption, persistent problems after SFC.
- CHKDSK: slowness of Boot, blue screens, read/write errors or suspected damaged sectors.
Create a maintenance .bat script
If you want to automate, open Notepad and paste lines like this: sfc /scannow, DISM /Online /Cleanup-Image /ScanHealth, DISM /Online /Cleanup-Image /RestoreHealth and, if applicable, chkdsk C: /f /r. Save it with the .bat extension and run it as administrator when you need it.
When that's not enough and you have to reinstall
There are scenarios where, no matter how hard you try, it can't be fixed with commands. Consider reinstalling Windows when:
- Failures persist after SFC/DISM/CHKDSK or reappear shortly thereafter.
- There are infections of malware important factors that compromise the system.
- Performance is terrible, with continuous crashes and erratic behavior.
- A critical update left the system unstable beyond repair.
- You have changed key hardware (motherboard, disk, etc.) and there are driver conflicts.
If you choose to reinstall, remember to prepare your backups and installation media. A clean reinstall is slower, but sometimes it's the most reliable way. to start over without any baggage.

Best practices, special situations and extra tips
To top it all off, there are a handful of complementary recommendations and commands that will come in very handy. Applying them makes the difference between a "botched job" and a textbook repair..
Quick diagnostics and utilities
To check the status of your disks at a glance, use wmic diskdrive get model,status. If “OK” appears, the firmware does not detect any obvious problems. (It does not replace a complete SMART assessment, but it provides guidance).
If you're having network issues (unstable connection, strange DNS), run: netsh winsock reset and, if applicable, ipconfig /flushdns. With ipconfig /all You will see IP, gateway, and DNS settings. to rule out basic network failures. If the message "the RPC server is unavailable" appears, consult How to solve it.
Optimization and periodic maintenance
Schedule regular checks: SFC every couple of months and CHKDSK if you detect unusual disk behavior. Keep Windows Update up to date to receive patches and stability improvements.
Optimization also helps: remove temporary files (Win + R > %temp%), manages the start in the Task Manager and adjust visual effects in “Adjust the appearance and performance of Windows”. The less baggage the system has, the less likely corruption is to occur..
Run in non-boot environments
If Windows does not start, use the Recovery Environment (Winor an installation USB drive. From the recovery environment's Command Prompt, you can launch: sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows. Replace C:\ with the actual drive letter if it does not match.
For offline DISM, mount an image or point to the \\sources folder of an installation media with /Source and adds /LimitAccess. This way you avoid depending on Windows Update when there is no network or it is broken.
Windows versions and features
Check your version with winver. En Windows 7 The alternative to classic DISM is the System Update Readiness Tool (SURT), downloadable from the Microsoft Update Catalog, which serves a similar role in repairing components.
Interpreting common blocks and errors
Does CHKDSK "stay" at a certain percentage for a long time? This may indicate severely damaged sectors. Give it some time; if it doesn't progress after a few hours, it's time to think about backing up the data and replacing the drive.Is SFC failing to start? Check admin permissions and consider Safe Mode. Is DISM returning 0x800f081f? Add /Source with a valid image and /LimitAccess.
Additional useful commands
sfc /verifyonly: diagnosis unchanged.DISM /Online /Cleanup-Image /StartComponentCleanup: cleans components and reduces the WinSxS store.chkdsk /spotfix: faster spot correction (NTFS).
Can I lose data with these commands?
Under normal circumstances, SFC and DISM don't affect your personal files. CHKDSK can identify bad sectors, and if data happened to be there, it might not be recoverable. That's why we insist so much on prior backups.
What if I don't want to type every time?
Create your .bat file and include it in your monthly maintenance. You can even add a small activity log with outbound redirects, for example: sfc /scannow > C:\logs\sfc.txt. This way you'll have a record of what was done and the results..
Third-party tools and data recovery
If you don't detect system corruption but your PC is running slowly, a cleaning and optimization suite can help remove bloatware and temporary files. To recover files from a computer that won't boot, consider using recovery software with bootable media. before repairing or reinstalling, and then revert to native commands.
Practical examples ready to copy
Classic online repair sequence: sfc /scannow > DISM /Online /Cleanup-Image /ScanHealth > DISM /Online /Cleanup-Image /RestoreHealth > repeat sfc /scannow. This workflow resolves a large part of day-to-day issues..
System disk check: chkdsk C: /f /r (Schedule for restart if requested). For hot checking, use chkdsk C: /scan.
Offline repair with local origin: DISM /Online /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim /LimitAccess (adjust the unit letter). Useful when Windows Update isn't cooperating.
Quick hardware check of storage: wmic diskdrive get model,status. If something doesn't "look OK", reinforce the diagnosis with SMART and copies..
After all of the above, your toolbox is well stocked: SFC for protected files, DISM for the Windows image, and CHKDSK for disk health, with support from netsh, ipconfig, and wmic when needed. By combining organization, patience, and backups, you'll have a much better chance of restoring stability to your PC. without needing to reinstall at the slightest.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.
