Can't get this command to run: DISM /online /Cleanup-Image /SpSuperseded

(imported topic written by GregSa)

This command “DISM /online /Cleanup-Image /SpSuperseded” is used to free up space from a Windows 2008 server, I can run it locally from a CMD box or even stick it inside a .bat file and run it locally but when I tried to make it a custom action it didn’t work. Can anyone see if they can get it to run on a windows 2008 server? It will free up about 3-4GB from your C:\ drive

Here is what my action script looked like. The copy worked but the execution of the .bat file didn’t.

prefetch Disk_Cleanup_Superseded_Patches.bat.tmp sha1:e4c61f3b6f2179879c6c61039827d5df9a05a5ad size:120 http://+MYSERVER.MYDOMAIN+.net:52311/Uploads/e4c61f3b6f2179879c6c61039827d5df9a05a5ad/Disk_Cleanup_Superseded_Patches.bat.tmp

extract Disk_Cleanup_Superseded_Patches.bat.tmp C:\windows

waithidden “C:\windows\Disk_Cleanup_Superseded_Patches.bat”

Thank you!

(imported comment written by SystemAdmin)

I’ve built hundreds of fixlets based off from the DISM utility.

Take a look at any of the Install or uninstall fixlets listed here. Look at the action script to see if it does what you’re hoping your’s would do.

I know mine relates to installing/uninstalling fixlets, but giving the full path of DISM and valdiating it’s existance added quality to these fixlets and might solve your issue.

http://bigfix.me/cdb/search/dism

(imported comment written by cstoneba)

I’m also trying to execute the dism command, but keep getting an exit code 11 and dism doesn’t do anything. The command works from command prompt, but not with TEM executes it.

Anyone know of the cause?

wait cmd.exe /c “{value of variable “WinDir” of environment & “\SysWOW64\dism.exe /online /cleanup-image /spsuperseded”}”

(imported comment written by cstoneba)

resolved, had to have wow64 redirection:

action uses wow64 redirection {not x64 of operating system}

waithidden “{pathname of system folder}\dism.exe” /online /cleanup-image /spsuperseded

(imported comment written by jkieler)

Has anyone been able to solve the issue of Dism.exe not working in TEM?

(imported comment written by cstoneba)

It works fine for me, but can take around 20min to complete:

action uses wow64 redirection {not x64 of operating system}

waithidden “{pathname of system folder}\dism.exe” /online /cleanup-image /spsuperseded

The action script ran successfully (Completed on console) but the disk space hasn’t actually cleared up on the computer. Has anyone faced this issue on their computers?

Have you rebooted your computer since running it? IIRC, some of the components actually clean up on reboot (with the same long “Applying Updates” message as if you had installed an update).

How much space is being used, especially the WinSxS folder, and how much cleanup are you expecting? Now that monthly rollups are cumulative, I’m not sure how much benefit is normal with this tool anymore.

1 Like

We haven’t rebooted the computer.

The winsxs folder is around 14.6GB. We’d like atleast 6GB to be cleared (which is what the Disk Cleanup would do).

Okay, it works now!

But there is still the matter of being able to clear more than 3GB.

If Disk Cleanup is doing better, I’m pretty sure I have tasks out at bigfix.me to run the disk cleanup command. Let me know if that’s the case.

Is there any task available other than in https://www.bigfix.me/fixlet/details/6133?

If so, I would like to know what they are :).

Are you having an issue with that one? It looks pretty thorough.

Yeah, that task never completes. Remains in the “Running” state.

You need to add /NoRestart otherwise it will prompt Y/N, leaving it with a status of Running.

waithidden "{pathname of system folder}\DISM.exe" /Online /Add-Package /PackagePath:"{pathname of client folder of current site & "\__Download\KB4517245.cab"}" /NoRestart