Windows File Compression automatically compresses files so that they take up less space. In the best of circumstances it can free up a lot of space, but all too frequently it's not as much as you might expect, and there is cost.
I was wondering if I should run the Disk Cleanup utility and select the Compress Old Files option to use Windows File Compression. It is currently taking up 14372KB of space. Should I compress old files?
While you’re only asking about the Disk Cleanup utility, I’m going to talk about Windows File Compression in more general terms. Using file compression to save space is nothing new, even when it’s native in the file system used by Windows. Whether or not it makes sense to use isn’t necessarily a slam dunk.
In fact, without knowing more, I get to use all three of my favorite answers:
After you’ve finishing beating your head against the computer, read on, and I’ll explain why I say all three. We’ll also discover that later versions of Windows itself have made a not-too-subtle suggestion as well.
Windows File Compression
Windows File Compression is a part of the NTFS file system and when enabled, it automatically compresses files to take up less space on the disk. Seems simple enough, right?
As a gross oversimplification, compression means replacing one representation of data with another that takes up less space. For example, the 10 character string “**********” (10 asterisks) might be replaced with three characters – “10*” – meaning “ten asterisks”. When decompressed, the “10*” would get transformed back into “**********”.
Now, of course, there are complications. For example, we need a way to make sure that if there’s actually a “10*” in the data before compression, we don’t try to turn it into “**********” on decompression.
Suffice it to say that real compression algorithms are exceptionally complex technologies, bordering on an art form.
Compression pros and cons
If good compression can “makes things smaller,” what’s the catch?
In my opinion, there are two big ones.
Compression is work. One thing that all compression algorithms share is that they require calculation. That means when you compress or decompress a file on your computer, your CPU needs to do more work than if the file were not compressed. Different algorithms have different calculation characteristics. Some require a great deal of CPU processing to compress the data, while the decompression can be lightning fast. Others compress comparatively poorly, but take less time to do it.
Compressing files that are already compressed doesn’t help. A file that has already been compressed by a reasonably good compression algorithm will typically not compress well if you try to compress it again with another. In fact, in the worst case, “compressing” a compressed file can sometimes even make it bigger. Many files that you use every day are already compressed. Typically audio, video, and image formats are already using compression algorithms as part of the file format. MP3, JPEG, MPG, and similar file types are all already compressed and typically do not benefit much, if at all, from attempts to compress them further.
When to Compress
I’d consider the following:
- If the files you’re considering compressing are used infrequently, then they might be candidates. The “old files” from a disk cleanup utility probably fall into this category.
- If the files you’re considering compressing aren’t already compressed, then it could make sense. There’s no way for me to know what files disk cleanup is pointing you at, so I can’t say how this might apply to you.
- If you have a powerful enough CPU, you might be able to compress files used more frequently and not notice. I definitely wouldn’t compress files I use frequently on an older machine. It can slow down your machine as the CPU gets more involved in every disk access.
- Realize that compressed files and compressed file systems are much harder to recover in the event of a crash. Make sure that you’re appropriately backed up.
My advice? In general, I wouldn’t bother.
Compression on average may recover only about 50% of the space used by files you compress. Maybe. If you’re really running into space problems then you should probably start instead by looking at exactly what is on your hard disk and what’s taking up all that space. If there’s nothing that you can remove or otherwise manage, then you’re probably better off upgrading your hard disk or adding a hard disk to your system.
On the other hand, if you can’t afford a hard drive or one can’t be added or upgraded for some reason, then compression might be a viable option as a last resort; in fact, it might be the only option.
I have no compressed file systems on any of the computers I run. I’ve done so in the past only on laptops where adding or replacing a hard drive just wasn’t in the cards for me, and only after other options didn’t free up enough space.
Compressing files with Windows File Compression
You don’t need to use the Disk Cleanup Utility to compress files – you can make choices yourself and pick and choose which files or folders of files you want to have compressed.
You can compress an individual file, but that’s not really all that useful, so I’ll show how to compress (and then decompress) an entire folder.
In Windows Explorer, right-click the folder and click Properties. Here, I’ve right-clicked on a folder named “cygwin” which contains several subfolders of a number of utility programs.
You can see there the disk space that’s taken up by the folder and everything it contains. (“Size” represents the actual data stored in all the files, while “Size on Disk” represents the amount of disk space allocated to those files figuring in all the filesystem overhead.)
Click the Advanced… button.
Check the box labeled “Compress contents to save disk space,” and then click OK. You’ll then be presented with a confirmation dialog:
Because we want to make the change to this folder and everything it contains, make sure that Apply changes to this folder, subfolders and files is selected and click OK.
Windows will then proceed to compress the files on disk. This can take some time depending on the number of files involved and the speed of your computer. My example above took a little over five minutes. Here’s the Properties dialog after the compression:
You can see that the files contain exactly the same amount of information, but take up less space on the disk. My net disk space saving is a little over 20% in this case. Remember, your results will vary depending on the types of files being compressed and how compressed they already are.
Other than disk space and possible performance impacts, nothing changes. You continue to use the files exactly as before they were compressed. That’s the beauty of Windows File Compression – it’s built in and transparent to all the applications that use the files.
Decompressing files compressed with Windows File Compression
To decompress files that you or some other process previously compressed, just repeat the steps above but make sure that the box labeled Compress contents to save disk space is unchecked.
It’s just that simple.
Where’s the Compress Old File option in Windows 7?
If you’ve fired up the Disk Cleanup tool in Windows 7, you may have noticed something.
Here’s the tool in Windows XP:
And here’s the tool in Windows 7:
I haven’t shown all the possible options in either, but something’s missing.
It’s the option to Compress old files in Windows 7.
If you want to use disk compression in Windows 7, you’ll need to do it manually.
Personally, I take this as a somewhat passive sign from Microsoft that they didn’t think much of the feature either.