Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Windows»How to Run DISM Commands to Repair Windows

How to Run DISM Commands to Repair Windows

chunanBy chunanDecember 4, 2022
dism-commands

The DISM command tool is a powerful Windows tool that can edit or repair Windows image files. If you are having issues with your system, you can run the DISM command to try and fix such errors. You can use the command prompt or the Windows Powershell to run DISM commands and fix your system. 

However, some errors can completely make your PC unusable, restricting you from booting into Windows. In that case, you will have to boot into the Windows Recovery Environment and run the DISM commands from there.

Table of Contents

  • How to Run DISM Commands to Repair Windows?
    • Using Command Prompt
      • Online DISM
      • Offline DISM
      • Additional Commands
    • Using PowerShell
    • Using Batch File

How to Run DISM Commands to Repair Windows?

DISM stands for Deployment Image Servicing and Management. Although DISM has a variety of uses, this tool is commonly used to fix a malfunctioning Windows system. This is a command exclusive tool that needs to be run from the command prompt or the Powershell.

Using Command Prompt

To fix your Windows system, the DISM command is generally followed by switches that represent the target image, which can be either /Online or /Image. The /Online switch will select your current running operating system as a target to fix, whereas /Image will allow you to specify another Windows image.

There is one mainstream command which we will use to repair Windows. There are a couple of other commands as well, which you can use to check for errors and repairability before repairing it.

The general syntax to fix a Windows image is:

DISM [target image] /Cleanup-Image [servicing_option] [servicing_parameter]

  • [target-image]: Target of the image you want to repair.
  • [servicing_option]: Type of service.
  • [servicing_parameter]: To include any exclusive parameters.

Online DISM

An online Windows image is the image that is currently in use to run the Operating system. When doing an online DISM with no servicing parameters, it takes files from previously downloaded Windows update components. However, if these update components are corrupt, it will download them again, which requires an internet connection.

But in case you don’t have internet to re-download the corrupt update components, you can also specify another Image as the source. You can create and insert a Windows installation media and use it as the source.

Follow these steps to learn how to run an online DISM:

  1. Press Win + R.
  2. Type cmd and press Ctrl + Shift + Enter to run it with elevated privileges.
  3. Type the following commands and execute them individually:
    • DISM /Online /Cleanup-Image /CheckHealth : To quickly check the image for errors.
    • DISM /Online /Cleanup-Image /ScanHealth : To check for any corruption and repairability of the image.
    • DISM /Online /Cleanup-Image /RestoreHealth : To repair any errors or issues encountered.
      online-dism-command

To use a specific Windows image as a source, use the following command:

DISM /Online /Cleanup-Image /RestoreHealth /source: <drive_letter>\sources\install /LimitAccess

Here, replace <drive_letter> with the letter of the drive containing the source image. 

Offline DISM

While online DISM targets the current operating system, offline DISM targets a specific Windows image. You will have to specify the path to the partition that holds your operating system as the target image. 

However, Offline DISM specifically requires a .wim file as the source of repair. You can use the .wim in installation media, ISO file, or Windows Image File Format from different PC as a source for repair.

If you’re able to boot into your system, you can open the command prompt by following the above steps instead of booting into Windows RE. 

  1. Force restart your PC three times to boot into the Windows RE.
  2. Go to Troubleshoot > Advanced option > Command prompt. 
  3. Type notepad.exe and press Enter. 
    notepad-exe
  4. Go to File and click on Save as.
  5. You can check the drive letter and path of your ‘source /target images’ from the save as window to use with the commands. The drive letters of your source and target image will be changed in the recovery environment.
    The source .wim file is usually located in the sources folder, which you can check and confirm from this window as well.
  6. Type the following command and execute it:
    DISM /Image:<target-drive-letter> /Cleanup-Image /RestoreHealth /source:<source-path> /limitaccess
    Here, replace <target-drive-letter> with the drive letter of the image you want to repair and <source-path> with the path to the Image file.
  7. For instance: DISM /Image:C:\ /Cleanup-Image /RestoreHealth /source:D:\sources\install.wim /limitaccess
    offline dism
    This command will fix the image in C: drive by using the .wim file in D: drive. In some cases, there may also be a .esd file instead of the .wim file. This file is usually located in the sources folder of the installation media.
    Replacing /RestoreHealth with /Scanhealth or /Checkhealth will run the respective commands.

Additional Commands

You can also add special parameters to the DISM command. Adding parameters will execute the DISM command and the added parameter simultaneously. Here are a couple of parameters to consider:

  • /Quiet: Disables progress information and only outputs error messages.
  • /NoRestart: Prevents your PC from rebooting.

If you want to learn about even more commands, you can check Microsoft’s official website for them.

Using PowerShell

Windows Powershell is another command line tool on your Windows PC. Although the Command prompt is common while running DISM commands, you can also use Powershell to run them. However, the commands for PowerShell are different from the command prompt. Follow these steps to run DISM commands from the PowerShell:

  1. Press Win + X and click on Windows PowerShell(Admin).
  2. Type the following commands and execute them one at a time:
    • Repair-WindowsImage -Online -ScanHealth -Source <image_path> -LimitAccess
    • Repair-WindowsImage -Online -CheckHealth -Source <image_path> -LimitAccess
    • Repair-WindowsImage -Online -RestoreHealth -Source <image_path> -LimitAccess
      Replace <image_path> with the directory of the source image. Or remove the -Source <image_path> -LimitAccess command to use the default source.
      repair-windows-image

To run the DISM on an offline image, replace -Online with the -path “<drive-letter>\offline\Mount”.

Using Batch File

A batch file is an executable file that can run commands directly. They have a .bat extension and can be created by using text editor software. You can save this file in an easily accessible location and launch it whenever you have to run the DISM commands. Here are the steps to do it:

  1. Right-click on your desktop.
  2. Go to New > Text document.
  3. Copy and paste the following commands into the text file.
@ECHO OFF
DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth 


dism bat file

  1. Click on File and select save as.
  2. Input any name you like and end it with .bat extension.save as bat
  3. Navigate to your preferred location and press save.

Launch the file by double-clicking it whenever you need to run the DISM command.

how-to
chunan

I was always enthusiastic when it comes to technological advancements. Any chance to learn something new about computers excites me which is why i got into IT as well. Now I get to write about them as well.

Related Posts

how to make cursor bigger

How to Make Cursor Bigger

February 3, 2023
enable secure boot msi bios

How to Enable Secure Boot on MSI Motherboard

February 3, 2023
how to add device to microsoft account

How to Add Device to Microsoft Account

February 2, 2023
how to delete win backup files

How to Delete Backup Files on Windows

January 29, 2023
how to reset password on hp laptop

How to Reset Password on HP Laptop

January 30, 2023
Reset BIOS password

4 Ways to Reset BIOS Password

January 28, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
usb a vs usb c

USB A Vs USB C – What’s the Difference?

January 31, 2023
how long does a cmos battery last

How Long Does a CMOS Battery Last

January 25, 2023
thunderbolt vs usb c

Thunderbolt Vs USB C: What’s the Difference

January 25, 2023
You may also like
Razer Mouse Not Working

Razer Mouse Not Working? Here’re 9 Ways to Fix It

February 3, 2023
how to make cursor bigger

How to Make Cursor Bigger

February 3, 2023
surface-screen-flickering

Why is My Surface Screen Flickering? 6 Ways to Fix It

February 3, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday.

Type above and press Enter to search. Press Esc to cancel.