\\ Amazon 在庫処分セール 掘り出し物をチェックしよう //

How to Use the Windows DISM Command | Manage and Repair System Images

目次

What is the DISM Command?

DISM (Deployment Imaging Service and Management Tool) is a powerful Windows tool for managing and repairing system images. It is primarily used to fix corrupted system files, manage Windows image files (WIM or VHD), and configure Windows features. DISM is essential for system administrators and troubleshooting tasks.

Main Uses

  • Repair system files: Detect and repair corrupted system files in a Windows installation.
  • Maintain Windows images: Manage and deploy Windows image files (WIM or VHD).
  • Enable or disable Windows features: Install, remove, or update Windows features and drivers.

How to Use the DISM Command

https://twitter.com/tama_global/status/1848630357299761436

The DISM command can be used for system repairs and image management. Here are some common usage examples.

Basic Syntax

DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth
  • /Online: Targets the currently running Windows instance.
  • /Cleanup-Image: Cleans up or repairs the Windows image.
  • /CheckHealth: Checks for minor corruption in the system image.
  • /ScanHealth: Performs a full scan of the system image for corruption.
  • /RestoreHealth: Repairs corruption in the system image.

Key DISM Command Options

  1. Check for System Image Corruption
DISM /Online /Cleanup-Image /CheckHealth

This command checks if the system image is corrupted. It runs quickly and reports whether corruption exists.

  1. Scan the System Image
DISM /Online /Cleanup-Image /ScanHealth

Performs a thorough scan of the system image to detect any corruption but does not attempt repairs.

  1. Repair the System Image
DISM /Online /Cleanup-Image /RestoreHealth

Repairs the corrupted system image, usually by downloading the necessary repair data from the internet or a network share.

  1. Manage Windows Features
DISM /Online /Enable-Feature /FeatureName:<feature name>

This enables specific Windows features, such as .NET Framework or Telnet, directly from the command line.

  1. Mount and Unmount Images
DISM /Mount-Wim /WimFile:<path> /Index:<index number> /MountDir:<directory>
DISM /Unmount-Wim /MountDir:<directory> /Commit

Mounts a Windows image file (WIM) to access its contents, and once done, unmounts the image and saves any changes with the /Commit option.

Practical Use Cases for DISM

1. Automate System Repair

DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow

First, repair the system image with DISM, then use sfc /scannow to scan and repair individual system files. This combination is effective in fixing both image corruption and individual file errors.

2. Enable Specific Windows Features

DISM /Online /Enable-Feature /FeatureName:NetFx3

This command enables the .NET Framework 3.5, demonstrating how easy it is to manage Windows features from the command line.

3. Manage WIM Files

DISM /Mount-Wim /WimFile:C:\images\install.wim /Index:1 /MountDir:C:\mount
DISM /Unmount-Wim /MountDir:C:\mount /Commit

Mount a WIM file, view or modify its contents, and unmount the image, saving any changes made.

Important Considerations When Using the DISM Command

  • Internet connection: When using /RestoreHealth, DISM may require an internet connection to download repair data via Windows Update.
  • Administrator privileges: Most DISM operations require the command prompt to be run as an administrator.
  • Long run times: Scanning or repairing a system image can take a while, particularly on systems under load.

Conclusion

The DISM command is a vital tool for managing and repairing Windows system images and features. It plays a critical role in resolving system issues, maintaining image health, and ensuring system stability. Using DISM effectively helps keep your Windows system running smoothly.

Tamaglo

Thank you for reading to the end!

執筆者:玉城 学(タマキ マナブ)

IT業界歴10年以上。ヘルプデスク・サーバーエンジニアとしてWindowsの設定、クラウド管理、PC最適化を担当。

現在はPC設定・Office活用の専門家として、ブログやYouTubeで情報を発信中。

詳しいプロフィールはこちら

Comments

To comment


The reCAPTCHA verification period has expired. Please reload the page.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here

目次