DISM /cleanup-image not working


I'm running Win 7 SP1, and trying to reclaim some space from the bloated winsxs folder (about 20GB !), using the DISM command.
However, when I run

dism /Online /Cleanup-Image /spsuperseded

I get:

Error 87
The cleanup-image option is unknown

Digging further in the dism.log, one of the log entry states:
DISM.EXE: No providers were found that support the command(cleanup-image).

Any idea what I am missing or doing wrong ?


I installed SP1 on top of a Win7 base.

And yes, I had previously run the Disk Compact tool, all options on, desperately trying to reduce the size of the OS footprint. But that produced minimal results, hence I gave DISM a go.

I don't get it: the winsxs directory is about 20Gb, and overall, the Windows directory is 39Gb. My SSD is only a 64Gb one, and I'm afraid at this rate there will come a time when I'll run out of space just because of Windows updates.

Is there really nothing out there to help diagnose/fix this insane consumption of space by Windows?

Windows 7 on a 64GB drive doesn't work well.  In my experience you need at least 128GB and for most people - 256GB or more.

Of course - I say this and sit happily with my 64GB SSD on this very machine.  I only have about 15GB free, but I have quite a large Outlook mailbox.  My C:\Windows\ folder (Windows 7 Enterprise, 64-bit) has 70159 files in 15072 folders containing ~17.7GB of data.  While the C:\Windows\winsxs directory is a good chunk of that at 42734 files in 10689 folders containing ~6.41GB - it's not near the size of your 20GB.  If you highlight all the files and folders in the root of my C:\ drive other than "Windows" and "Users" I have 37070 files in 5283 folders that take up ~13.1GB.  My "C:\USERS\" folder competes quite nicely at ~12.6GB - with ~12.5GB all under my one user account and ~6.78GB of that being Microsoft Outlook PST and OST files for four different email accounts.

So the question is - what did you do differently than what I did?

I don't know.  I am pretty sure I installed using media for Windows 7 *with* SP1 integrated.  However, when I run the command I have recommended dozens of times before...

    C:\Windows\system32>dism /Online /Cleanup-Image /spsuperseded

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7600.16385

    Service Pack Cleanup can't proceed: No service pack backup files were found.
    The operation completed successfully.

It works fine for me and politely lets me know that I don't have any service pack files to remove.


So... If you open an administrative command prompt and type in:

dism /?

And press enter... What do you get?

I get:

    C:\Windows\system32>dism /?
    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385
    DISM.exe [dism_options] {WIM_command} [<WIM_arguments>]
    DISM.exe {/Image:<path_to_offline_image> | /Online} [dism_options]
             {servicing_command} [<servicing_arguments>]
      DISM enumerates, installs, uninstalls, configures, and updates features
      and packages in Windows images. The commands that are available depend
      on the image being serviced and whether the image is offline or running.
      /Get-MountedWimInfo     - Displays information about mounted WIM images.
      /Get-WimInfo            - Displays information about images in a WIM file.
      /Commit-Wim             - Saves changes to a mounted WIM image.
      /Unmount-Wim            - Unmounts a mounted WIM image.
      /Mount-Wim              - Mounts an image from a WIM file.
      /Remount-Wim            - Recovers an orphaned WIM mount directory.
      /Cleanup-Wim            - Deletes resources associated with mounted WIM
                                images that are corrupt.
      /Online                 - Targets the running operating system.
      /Image                  - Specifies the path to the root directory of an
                                offline Windows image.
      /English                - Displays command line output in English.
      /Format                 - Specifies the report output format.
      /WinDir                 - Specifies the path to the Windows directory.
      /SysDriveDir            - Specifies the path to the system-loader file named
      /LogPath                - Specifies the logfile path.
      /LogLevel               - Specifies the output level shown in the log (1-4).
      /NoRestart              - Suppresses automatic reboots and reboot prompts.
      /Quiet                  - Suppresses all output except for error messages.
      /ScratchDir             - Specifies the path to a scratch directory.
    For more information about these DISM options and their arguments, specify an
    option immediately before /?.
        DISM.exe /Mount-Wim /?
        DISM.exe /ScratchDir /?
        DISM.exe /Image:C:\test\offline /?
        DISM.exe /Online /?


Although I would also be interested in what you get when you perform the last line of the above help file (dism.exe /online /?) - that is a LONG list on mine.  Snipping mine up a bit...

    C:\Windows\system32>dism /online /?
    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385
    Image Version: 6.1.7600.16385
    The following commands may be used to service the image:
    <.... snipped ....>
      /Add-Package            - Adds packages to the image.
    <.... snipped ....>
      /Get-FeatureInfo        - Displays information about a specific feature.
      /Cleanup-Image          - Performs cleanup and recovery operations on the
    <.... snipped ....>


And then, further along with the help...

    C:\Windows\system32>dism /online /Cleanup-Image /?
    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385
    Image Version: 6.1.7600.16385
    /Cleanup-Image /RevertPendingActions
      WARNING! This operation will revert pending actions from previous servicing
      operations. It should be used for recovery operations only. This command
      is not supported against an online image.
          DISM.exe /Image:C:\test\offline /Cleanup-Image /RevertPendingActions
    /Cleanup-Image /spsuperseded [/hidesp]
      WARNING! The service pack can't be uninstalled after this operation is
      completed. This operation will remove backup files created during service
      pack installation. Use /hidesp switch to hide the service pack from Installed
          DISM.exe /Image:C:\test\offline /Cleanup-Image /spsuperseded /hidesp


So my curiosity would be the version of your DISM.EXE and if you can use the /? command line variable to get as far as I did above.  Your Windows installation *is* taking up way too much space - since essentially you and I are using a similar sized system drive (64GB SSD) and I have all sorts of things installed other than just Windows (Office 2010, DVDFab 8, a couple of different web browsers, the normal suspects for Internet plugins, my antivirus and antimalware utilities and quite a few other things) on the same drive and have a decent sized folder related to nothing more than email (more than 10% of the drives total space is taken up by email related files) and I still have 15.4GB free of 59.5GB total.  All that and your Windows directory supposedly takes up all but 5GB of my whole system.


Just for clarity - when I run the very thing I asked you to run...

OS Version:                6.1.7601 Service Pack 1 Build 7601


You also may want to be in the c:\windows\system32 directory in your administrative command prompt.  Just in case you have other issues.


Also - did you go crazy with the updates and the LANGUAGE PACKS?  Or did you not install any you don't need?


If you do the following at the same command prompt:

dism /online /get-packages > c:\temp\packages.txt

and then open the c:\temp\packages.txt (you may need to create a C:\temp\ directory first) and see how many lines you have in that file in total (word-wrap off, status bar on, scroll down to the bottom and put your cursor on the last line and read the number of lines in the status bar) - what is it?

Shenan Stanley
MVP 2005-2011 & 2013-2015
Insider MVP 2016-

51 people found this reply helpful


Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.


Question Info

Last updated December 10, 2021 Views 308,383 Applies to: