How to Fix Corrupted Files on Windows 11
Fix corrupted Windows installation files that might be breaking your PC, causing errors and crashes, or even BSOD.
If you are experiencing Window crashes, random errors, app crashes, or you’re getting a blue screen error, it may be due to corrupted system files or missing files on your Windows 11 PC.
There are a number of reasons for which Windows files can get corrupted such as power outages, viruses, malware, hardware problems, update failures, software crashes, etc.
Fortunately, there are several ways to repair or replace corrupted files in Windows 11. Here in this article, we will explore all of them.
Scan for Corrupt files and Fix Them
SFC, which is short for System File Checker is a built-in command-line tool that allows you to detect and repair corrupt system files in Windows. SFC scan is the most common method to fix corrupt or missing system files in modern Windows computers. Let use see how to do that in detail:
First, launch the Command Prompt with administrative privileges access. To do that, click the Start menu or the search icon in the taskbar and search for ‘Command Prompt’ or ‘cmd’. Then, select ‘Run as administrator’ from the right pane.
Once the elevated Command Prompt launches, type the following command and press Enter:
The tool will check for errors or corruption of system files. If any corrupted or missing files are found, it will automatically repair/replace them with a cached copy.
Depending on files and apps on your computer, the process will take some time to finish. Once the scan is complete, you will see one of the following messages.
- “Windows Resource Protection did not find any integrity violations.” – It means no problems were found.
- “Windows Resource Protection found corrupt files and successfully repaired them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For example C:\Windows\Logs\CBS\CBS.log.” – It means the corrupted files and other issues were found and fixed.
- “Windows Resource Protection was unable to perform the requested operation” – If you see this message, you need to run the SFC scan on safe mode, which will be covered in the later section of this article.
- “Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log %WinDir%\Logs\CBS\CBS.log” – If this is the case, then you can manually repair them (which is also covered in this article) or use other following methods.
The above command performs a basic scan and resolves most of the problems. However, there are multiple syntaxes or parameters you can use with the command:
sfc /scannow– Scans all system files and replaces corrupted files if possible.
sfc /VERIFYONLY– Only scans the integrity of the system or protected files but it doesn’t perform any repairs. Make sure to specify the full path of the file or folder. E.g. –
sfc /SCANFILE– It scans the integrity of the specified file and performs repairs if necessary. E.g. –
sfc /VERIFYFILE– This modifier verifies the referenced file but doesn’t perform any repairs. E.g. –
sfc /OFFBOOTDIR– This parameter performs offline repair on the boot directory. You must refer to the location of the offline boot directory.
sfc /OFFWINDIR– It is used to perform offline repairs on the Windows directory. You must specify the location of the offline boot directory.
sfc /OFFLOGFILE– This parameter enables logging of the SFC scan results by specifying a log file path.
View and Analyze System File Checker logs
After performing every scan, System File Checker generates a log file named ‘CBS.log’ to list every file that was scanned and every file that was repaired.
You find the SFC scan log file in the following location:
Open the File Explorer and navigate to the above location and double-click on the ‘CBS.log’ text file view the SFC repair details in Notepad.
You can also create a separate log file in a specific location using the below command:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "C:\SFClogs\sfclogs.txt"
C:\SFClogs\sfclogs.txt with a path to the location where you want to create the log file.
Or use this command instead to create an SFC log file on the desktop:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfclogs.txt"
Run DISM Commands to Restore Corrupted Files
DISM (Deployment Image Servicing and Management) is a command tool developed for administrators and experts to scan and repair Windows images including, Windows Recovery Environment, Windows Setup, and Windows PE (WinPE).
If the above method fails to fix the corrupted files, then you can run a DISM (or Deployment Image Servicing and Management) scan instead. DISM first scans your computer for corrupted or missing files associated with different Windows services. After that, it will download the required images and files from the Microsoft server and replace the corrupt files. For this to work, you will need an active internet connection.
To run this tool, open Command Prompt as administrator, the same way you did for the SFC scan. Then, type the following commands one after the other and press Enter for each command:
DISM/Online /Cleanup-image /Scanhealth
Once the first command finishes the scan, enter the next one to restore the corrupted files.
Or, you can also try the following command:
DISM /Online /Cleanup-Image /RestoreHealth /source:F:\Sources\Install.wim:1 /LimitAccess
Don’t interrupt the process until it is done. After the process is completed, restart your PC and see if the problem is resolved or not.
Perform DISM Offline Repair
If you don’t have internet connectivity or connection problem, use the below command to perform offline repair:
DISM /Image: C:\offline /Cleanup-Image /RestoreHealth /Source: c:\test\mount\windows
If you see the “Windows Resource Protection detected corrupted files and successfully restored them.” message, it means DISM has found and fixed the corrupted files. You can then restart your PC and see if the problem is resolved.
Run System File Checker (SFC scan) in Safe Mode
If the System File Checker (sfc) scan and DSIM scan don’t fix your corrupted files, then you can try rebooting your system in safe mode and running the SFC scan in it. The third-party apps and programs are often the cause of files corruption or system crash in Windows, so when you boot your system in safe mode, it loads only a minimal set of drivers and services without any third-party involvement.
Hence, running SFC in this diagnostic mode may help to fix the issue you are facing. Here’s how:
To boot your system into Safe Mode, press Windows+R to open the Run command box. Then, type
msconfig in the text field and hit Enter.
When the System Configuration control panel opens, move to the ‘Boot’ tab and click the box in front of ‘Safe Boot’ under Boot options to enable the option. Then, click ‘Apply’ and then ‘OK’.
After that, click ‘Restart’ in the confirmation box to reboot your system in safe mode now (automatically), or click ‘Exit without restart’ to restart your PC later (manually). If you select ‘Exit without restart’ you can save your work and close all the open programs properly.
After the system restarts in safe mode, log into your PC. Search for ‘cmd’ or ‘command prompt’ in the Windows search and click on ‘Run as administrator’ for the command prompt app in the search results.
When the Command Prompt window opens, type the below command and press Enter.
After the scan is complete, you need to disable safe mode and reboot your system in normal Windows mode. To do that, open the System Configuration tool again by running the Run command box, typing ‘msconfig‘ in the dialog box, and clicking ‘OK’.
In the ‘System Configuration’ box, go to the ‘Boot’ tab and disable the ‘Safe Boot’ option under Boot options. Then, click ‘Apply’ and then ‘OK’.
After that, click ‘Restart’ in the confirmation box to restart your system in normal mode.
Use Startup Repair to fix Corrupted Files
If your Windows 11 fails to load or keeps crashing down due to corrupted files, you can start up repair to solve issues. It can also be used for repairing corrupted or broken files in Windows 11. Follow these steps to startup repair:
First, open Windows 11 settings by right-clicking the Start button and selecting ‘Settings’ from the list of options. or press the Windows+I shortcut.
Go to the ‘System’ section on the left pane and click the ‘Recovery’ option on the right pane.
On the Recovery settings page, click on the ‘Restart now’ button next to the Advanced startup.
Now, your computer will enter the Windows Recovery Environment (WinRE). WinRE is a recovery environment that helps you with troubleshooting common booting problems, recovery, or booting from external media.
If your computer is not booting properly for you access the above settings. There are alternative ways to access the Windows Recovery Environment (WinRE).
Using Hard Reboot
First, shut down your PC or turn off your PC and then press the power button to turn on the system. And just when Windows starts loading, press and hold the power button to force shutdown your PC.
Repeat these steps two or three times and the fourth time let Windows load normally. It will automatically boot into Windows Recovery Environment (WinRE). When the automatic repair screen appears, click ‘Advanced Options’.
Using Windows Installation Media
If the above method doesn’t work, insert Windows 11 installation media on disk or USB into your computer. Then boot your system from that installation media. When the Windows Install now screen appears, click the ‘Repair your computer’ option at the bottom.
After the Windows Recovery Environment appears, click the ‘Troubleshoot’ option under the Choose an option screen.
Next, click ‘Advanced options’.
Under the Advanced options window, select the ‘Startup Repair’ option.
Now, the Startup Repair tool will diagnose your system and fix the corrupted files if possible.
Run an SFC Scan Before Windows Starts
If the above method also fails, you can try running the SFC scan before Windows starts (in the Windows Recovery Environment). SFC cannot scan certain protected files when Windows running, that is why you need to run an SFC scan before Windows starts. Follow these steps to do that:
First, open the enter the Windows Recovery Environment (WinRE) using the same steps in the above method.
Once you are in the Choose an option screen, click the ‘Troubleshoot’ option.
On the next screen, click ‘Advanced options’.
Next, under Advanced options, select ‘Command Prompt’.
This open will Command Prompt window with administrative privileges in which you can perform advanced troubleshooting.
Windows is usually installed on the C drive but here the Windows directory will be different. If you are not sure, enter the below command to find the driver of where Windows 11 is installed and press Enter:
wmic logicaldisk get deviceid, volumename, description
Note down the volume name. In most Windows 11 PCs, Windows Volume Name will be assigned to D or X. When you run the Command Prompt before Windows starts, most of the drive letters will be mismatched as shown below.
After that, enter the following command to start the scanning process
sfc /scannow /offbootdir=X:\ /offwindir=F:\Windows
In this example, the boot directory is X and the Windows directory is F. Make sure to use the correct drive letter you got from the above command.
The scanning process will take some time to complete. Once it’s done, close the Command Prompt and start the Windows 11 normally.
Perform System Restore
System Restore is another great way to fix corrupted or damaged files on Windows 11. Windows System Restore feature automatically creates restore points whenever there are major changes in your system, like software installation, device installation, Windows update, etc. Besides that, the restore points can also be created manually.
This feature will restore your system to a previous state or point in time and undo all the recent changes (including the corrupted files) made to the PC. It will restore your Windows and important system files (like drivers, installed programs, Windows Registries, and system settings) to a previous state. Here’s how you can do that:
Click the Start menu or press the Windows key and search for ‘System restore’ in the Windows search and select the ‘Create a restore point’ control panel in the result.
When the System Properties window opens, click on the ‘System Restore’ button under the ‘System Protection’ tab.
The System Restore feature may suggest a recommended restore point if you have one. If you want that you can select the ‘Recommended restore’ option or ‘Choose a different restore point’ option if you wish to use a different one and click ‘Next’. If you don’t see the suggestion, then simply click ‘Next’ to continue.
The next screen will show a list of all restore points available (manual and automatic) with timestamps and brief descriptions. Select the desired restore point and click ‘Next’.
Make sure to choose a restore point before your files were corrupted or at the time of file corruption.
Finally, click the ‘Finish’ button to start the restoration process.
Now, your system will be restored to the state it was in before the selected event and the original files will replace the corrupted files.
Manually Replace the Corrupt Files
If the SFC scan or DISM scan doesn’t fix the corrupted files, you may need to manually replace a corrupt system file with a good copy of the file. You can get a good copy of the corrupted system files from another Windows 11 PC or the internet.
To do that, first, you need to find which file is corrupted using the SFC log file. The SFC log file will list all the corrupted Windows files.
Copy the good copy of the corrupted files from another computer or download it from the internet. Open the directory where the corrupted file is located and delete it.
Copy and paste the fresh copy of the file to the same directory. Then restart your computer.
However, if the corrupted file is protected, you cannot replace it with the above method. In that case, use the following steps:
First, open Command Prompt with administrative privileges. Then, type the following command to take ownership of the file:
takeown /f path\filename
In the above command, replace
path with the path to the corrupted file and
filename with the corrupted file name.
takeown /f C:\Windows\System32\MUI\0409\mscorees.dll
Next, enter the below command to grant full administrator access to the corrupted file:
icacls path\filename /grant administrators:F
path\filename with the path to the corrupted file and the file name.
icacls C:\Windows\System32\MUI\0409\mscorees.dll /grant administrators:F
The above command grants full access to ‘mscores.dll’ file.
Now, you need to copy the new file and replace it with the corrupt one.
copy source path\filename destination path\filename
In the above syntax, replace
source path\filename with the path and name of the new file and
destination path\filename with the path and name of the corrupted file.
copy C:\Users\rajst\Downloads\New\mscorees.dll C:\Windows\System32\MUI\0409\mscorees.dll
CMD will ask you for confirmation to overwrite the file, press
y, and then Enter.
This will replace the corrupted file with the new good file.
Finally, use the below command to verify the integrity of the system files:
If you only want to check the integrity of the newly replaced file, use the below command:
Check for Windows Update
In some cases, running an outdated Windows could cause file corruption and various other issues on your computer. So updating Windows with the latest available update may help fix the problem. Here’s how you can update Windows 11 PC:
Click the Start menu and select ‘Settings’ or press Win+I to open the settings app.
In the Windows Settings, select the ‘Windows Update’ tab on the left pane and click the ‘Check for updates’ button on the right-side pane.
If there are any updates pending, Windows will start downloading and installing automatically. Sometimes, you have to manually select the ‘Install’ button to install the available updates.
After the update is finished, restart your computer.
Run System Maintenance Troubleshooter
You can also run System Maintenance Troubleshooter to search for errors and corrupted files all around the system and fix them. Here’s how you can run the System Maintenance troubleshooter:
Open Windows Search and search for ‘Control Panel’ or open Run command, type ‘control panel’, and hit Enter to launch Control Panel.
In the Control Panel, head over to the upper right corner, click the ‘View by’ drop-down, and select ‘Large icons’.
From the list of settings, click ‘Troubleshooting’.
In the Troubleshooting window, click on ‘View all’ from the left side panel.
After that, the All Categories control panel will open with the list of various troubleshooters. Here, click on ‘System Maintenace’ from the list.
This will launch the System Maintenance troubleshooter. Now, click the ‘Advanced’ setting in the lower-left corner.
Then, click the ‘Run as administrator’ link to run the troubleshooter with administrator permissions to perform a more thorough scan of your computer.
After that, click ‘Next’ to start the process.
The troubleshooter will check your computer for unnecessary or corrupt files and fix them for you if any are found.
Run Check Disk Command (CHKDSK)
Check Disk Command (CHKDSK) is another error-checking command-line tool that can be used to fix errors and corrupted files in the drive or directory. It can also be used to check for errors in drivers other than Windows drive.
Open Command Prompt with administrator access and enter the below command:
chkdsk [drive or file path] /f /r /x
In the above command replace the
[drive or file path] with a path to the corrupted file or drive letter.
chkdsk E: /f /r /x
However, if you try to Check Disk command on Windows drive (C:), it will ask if you would like to schedule this volume to be checked the next time the system restarts. Type ‘Y’, and hit Enter.
Perform a Check on the Driver using the Error Check Function
You can also check for errors or corrupted files using the Erro Check function from drive properties. Here’s how you can do that:
First, open the File Explorer and right-click on the drive that has corrupted files. Then, select ‘Properties’ from the context menu.
On the Properties windows, go to the ‘Tools’ tab and select ‘Check’ under the Error Check section.
After that, click the ‘Select drive’ option.
The tool will check for errors and fix them for you.
Reset Your Windows 11 PC
If none of the above methods can’t help you fix your corrupted files, then you can reset your Windows PC to fix the issue. Resetting Windows will reinstall the Windows 11 OS from the backup image or cloud service. When reinstalling Windows, you can choose to keep your personal files while removing all the apps and settings.
You will get an option to keep your personal files but everything else will be removed (from the C drive) including all the third-party apps, drivers, system files, and settings. Resetting Windows will re-install Windows OS, removing all corrupted/damaged files and replacing them with fresh system files. Follow these instructions to reset your Windows 11 PC:
Open the Windows 11 Settings app by pressing Win+I or from the Start menu. In the Settings app, go to the ‘System’ tab, scroll down and click the ‘Recovery’ option on the right.
Under the Recovery options section, click the ‘Reset PC’ button.
Once you do, a new dialog window called Reset this PC will appear in blue.
Here, you can choose whether you want to ‘Keep your files’ but remove apps and settings or ‘Remove everything’ including your personal files from the libraries. Now, select an option according to your choice to continue.
Next, choose how would you like to reinstall Windows – whether with a local backup image from your device or via Cloud download and reinstall Windows.
If you choose ‘Cloud download’, it will download and reinstall the latest build of Windows 11 but it will also require internet and 4GB of data. But if you choose ‘Local reinstall’, it will reinstall the same build of the OS from the hidden backup image in the device.
Since we are trying to fix corrupt files, it’s better to use ‘Cloud download’ because this option will download the latest build of the OS.
In the next windows, click the ‘Next’ button.
Finally, click the ‘Reset’ button to start the resetting process.
The process will take some time to finish and once done, you will have a fresh Windows 11 OS without any issues.