![windows server script to clean up cab files in temp folder windows server script to clean up cab files in temp folder](https://www.isumsoft.com/images/windows-7/how-to-safely-clean-up-temporary-files-in-windows-7/type-commands-in-command-prompt-window.png)
2) Why isn't the Disk Cleanup wizard deleting these things? On a more rhetorical note: 1) Why does Windows not include them in the total by default, when you ask it how much space is being consumed by the C:\Windows folder? We were able to get it to start including it in the total by clicking directly on the Temp folder, and confirming when asked to elevate to gain access to the folder but hiding space usage of a potentially large folder by default just seems retarded. But why are they being created, and how do I get Windows to stop creating them? I'm assuming I can just nuke these things. The system has been creating one of these roughly 3 times/day, going back about a year. The bulk of the space is being taken up by files having names of the form cab_xxxx_xx, with a length of exactly 127837925 bytes and the exact same contents (looks like compressed data of some sort). For some reason, Disk Cleanup Wizard isn't touching this stuff either (we've run that multiple times). I booted a Linux live drive, and determined that the Windows folder was the culprit even though Windows claimed it had about 30GB of stuff in it, there was a Temp subfolder with ~140GB of crap in it.
![windows server script to clean up cab files in temp folder windows server script to clean up cab files in temp folder](https://cdn.windowsreport.com/wp-content/uploads/2021/02/CAB-batch-file-330x190.png)
Windows server script to clean up cab files in temp folder free#
The amount of space in use by all the top level folders (as shown by right-clicking and bringing up the properties) added up to just a little over 100GB, so there should've been a ton of free space.
![windows server script to clean up cab files in temp folder windows server script to clean up cab files in temp folder](https://i2.wp.com/directaccess.richardhicks.com/wp-content/uploads/2017/12/always_on_vpn_device_tunnel_powershell_05.png)
After several rounds of deleting old stuff and running Windows Disk Cleanup, the problem continued to come back every few weeks. The system has a 250GB SSD, and she kept getting into a state where there was 0 bytes free (causing the system to lose its mind). This started out as an exercise to figure out why she kept running out of disk space. My wife's desktop is having a weird issue, and having been mostly out of the Windows world for a while I'm appealing to the collective gerbil wisdom for ideas here.