How to repair Windows with DISM command?
In this tutorial we will demonstrate how to repair Windows with DISM which will resolve the problems by using very few commands.
You might have experienced after working with Windows Server or Windows 10 some strange errors and warnings come up. Most of these errors and warnings involve the breaking of a simple file in Windows. This may be a simple file but it can disrupt your Windows functions.
Here we will learn a useful approach to resolve this kind of issue.
DISM (Deployment Image Servicing and Management) is a command for optimizing and customizing Windows, which also can be used to repair Windows.
Repairing Windows with DISM:
- Run PowerShell terminal with Administrator access.
- At first you must have troubleshooting on your system, so you should run the command below.
DISM /Online /Cleanup-Image /CheckHealth
With the above command, the DISM will searches errors in the Windows log section.
There is another parameter which you can use for troubleshooting. This parameter is Scanhealth.
DISM /Online /Cleanup-Image /Scanhealth
This parameter, unlike the CheckHealth parameter, does not just look for log files. This command will automatically start checking all Windows files and will find any errors that are related to Windows.
Note: Running this command may take from 10 to 15 minutes as it will check each Windows file.
- Now, we will start repairing the Windows problems. For resolving the problems, you can use DISM command with Restorehealth
DISM /Online /Cleanup-Image /Restorehealth
After entering the above command, Windows starts recovering and replaces damaged files with healthy files.
Note: The DISM command, with the help of the Windows Update service, will start downloading the required files. If the Windows Update service is disabled or there is no internet connection, then this operation will not be successful.
Note: This action may take a long time.
Now we will show you how to change the source of the files for the DISM command. Now DISM will be usinfg local sources instead of the internet.
Changing DISM Sorce:
The DISM command has the ability to find files from different sources, and repair Windows from it. Resources such as DVD, Flash or even the Windows ISO files.
For changing source of DISM command, we use this command with source parameter. So if you want to use DISM command with RestoreHealth and define a special source, the command structure is like below command.
DISM /Online /Cleanup-Image /Restorehealth /Source:G:\Sources\install.esd
To specify the source, you must enter the address of the Install.esd file, either Install.win or Install.wsm, which is the original Windows installation file, and also note that in each media, there will generally be one of three files.
Note: To restore damaged files in Windows through the local source, your Windows version must be completely equal to the media version.
By using the above command, you will define a special source for DISM command but if required, the DISM will use other sources. If you want DISM to specifically use your defined source use limitaccess parameter.
DISM /Online /Cleanup-Image /Restorehealth /Source:G:\Sources\install.esd /Limitaccess
Now you know how to use the DISM command to fix the Windows bugs.