Drive Cleanup

Optimizing Windows: The DISM Component Cleanup Guide


Overview

The command Dism.exe /Online /Cleanup-Image /StartComponentCleanup is used to maintain and clean up the Component Store (also known as the WinSxS folder) in an online (currently running) Windows installation. The Component Store is a critical part of the Windows operating system that holds files necessary for system customization and updates. Over time, this folder can grow quite large as old versions of components are kept after updates.

This specific command helps to reduce the size of the Component Store by removing outdated or superseded components without removing any files needed by the latest installed updates.

Command Syntax

Dism.exe /Online /Cleanup-Image /StartComponentCleanup
PartDescription
Dism.exeThe executable for the Deployment Image Servicing and Management tool.
/OnlineSpecifies that the action will be performed on the currently running Windows operating system.
/Cleanup-ImageSpecifies that the operation is intended to clean up and service the Windows image.
/StartComponentCleanupThe specific action to clean up the Component Store (WinSxS folder) by removing superseded versions of components.

Prerequisites

  • Administrator Privileges: The command must be run from an elevated Command Prompt or PowerShell window (Run as administrator).
  • Operating System: Windows Vista/Server 2008 and newer.

Execution

  1. Open the Start menu and type cmd or powershell.
  2. Right-click on the appropriate result and select Run as administrator.
  3. Type the command and press Enter:Dism.exe /Online /Cleanup-Image /StartComponentCleanup

Expected Behavior

  • The command may take several minutes to complete, depending on the system’s condition.
  • The progress will be displayed in the console as a percentage.
  • The system might appear to be doing nothing for periods of time; this is normal. Do not interrupt the process.
  • A successful completion will display a message similar to:The operation completed successfully.
  • No reboot is typically required after running this command, although it is often paired with other cleanup commands that may require one.

Best Practices and Further Cleanup

While effective, StartComponentCleanup is often paired with other DISM parameters for a more thorough cleanup.

CommandPurpose
Dism.exe /Online /Cleanup-Image /StartComponentCleanup /ResetBaseA more aggressive cleanup that removes all superseded versions of every component in the component store. This prevents the uninstall of any existing updates, but allows you to save the maximum amount of disk space. Use with caution as you cannot uninstall updates after this.
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStoreAnalyzes the Component Store to report the actual size of the folder and determine if a cleanup is necessary.

Summary of Benefits

This command is a standard maintenance step to:

  1. Reclaim Disk Space: Significantly reduce the size of the WinSxS folder.
  2. Maintain System Health: Ensure the Component Store is optimized and free from unnecessary, outdated files.
  3. Improve Performance: While minimal, a smaller component store can slightly improve overall system responsiveness.