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.
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.
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”}”
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.
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