Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can use the Deployment Image Servicing and Management (DISM) tool to mount a Windows image from a WIM, VHD, or VHDX file and modify it.
Analyze and clean up the Component Store (WinSxS folder) in an offline Windows image
To complete the walkthrough, you need:
- A technician PC
- A .wim, .vhdx, or .ffu image of Windows 10, Windows Server 2016, or later.
Analyze the size of the Component Store in an offline Windows image
Copy your image file to the technician PC's local drive, for example:
C:\test\images.Open a Command prompt as administrator.
Create a folder for your mounted image, for example
C:\test\offline.Run
DISM /Get-ImageInfoto retrieve the name or index number for the image that you want to update. For example:Dism /Get-ImageInfo /ImageFile:C:\test\images\MyImage.wimNote
For .ffu and virtual hard disk files, the
index:will be1.Mount the Windows image:
Dism /Mount-Image /ImageFile:C:\test\images\MyImage.wim /Index:1 /MountDir:C:\test\offlineSince WIM files can contain one or more images, you must specify an index or name value. To mount an image from a VHD or FFU, you must specify
/Index:1.Analyze the size of the component store. For example:
Dism /Image:C:\test\offline /Cleanup-Image /AnalyzeComponentStoreTo learn about what's in the output, see Determine the Actual Size of the WinSxS Folder.
If the component store cleanup was recommended in the displayed report, then you can start cleanup of the image. For example:
Dism /Image:C:\test\offline /Cleanup-Image /StartComponentCleanupYou can reduce the size of the component store further by adding the
/ResetBaseparameter. For example:Dism /Image:C:\test\offline /Cleanup-Image /StartComponentCleanup /ResetBaseIn Windows 10, version 1607 and later, you can specify the
/Deferparameter with/Resetbaseto defer any long-running cleanup operations to the next automatic maintenance. Only use/Deferas an option in the factory whereDISM /Resetbaserequires more than 30 minutes to complete.A component cleanup maintenance task is scheduled to run weekly, with a two-week deadline. In the first week, the maintenance task will only run during system idle maintenance windows. If it's unable to complete (for example, the computer is turned off when not in use) then the task scheduler runs more often, and the task may run while the system is not idle.
To see the performance effects while the task is running, run:
Schtasks.exe /Run /I /TN \Microsoft\Windows\Servicing\StartComponentCleanupCommit the changes and unmount the image in order to save the changes that you’ve made. For example:
Dism /Unmount-Image /MountDir:C:\test\offline /Commit
Related topics
Determine the Actual Size of the WinSxS Folder
DISM Operating System Package Servicing Command-Line Options