There is indeed a program that will do that.
It’s called Microsoft Windows.
You don’t need to get any additional programs to decompress the files on your system; you can do it right from within Windows.
Become a Patron of Ask Leo! and go ad-free!
- Windows no longer offers to compress old files, though compression remains available.
- Decompressing files is done in Windows File Explorer.
- There’s also a command-line approach to compressing and decompressing files.
File compression uses various algorithms to reduce the physical space taken up by a file without loss of any information.
Once upon a time, Windows would offer to compress “old” files as part of the disk cleanup tool. That’s no longer present in current versions of Windows. However, file compression is still supported. You may find yourself with compressed files if you’ve updated systems from older versions of Windows, or if you manually enabled compression at some point in the past.
Here’s how a folder that has been compressed is displayed in Windows File Explorer.
You can tell it’s compressed by Windows because the folder name is displayed in blue instead of black.
If we look inside that folder, we see that all the files are compressed as well.
Once again, all of the filenames are in blue, indicating compression.
Decompressing using Windows File Explorer
Before you decompress files, make sure you have enough free space available — the files will take up more room when they are not compressed. If there’s not enough room, decompressing will fail.
Right-click on the compressed folder, click on Properties, and then click on Advanced.
As you can see, “Compress contents to save disk space” is checked.
Uncheck that and click OK. This will return you to the basic properties for the folder. Click OK here as well and you’ll be presented with one more option.
You can uncompress just the folder and not its contents. Any new files placed in the folder will not be compressed automatically.
However, you can also uncompress everything — the folder and everything inside of it — by selecting “Apply changes to this folder, subfolders and files”. Do that and click OK.
Depending on the size of the folder and its contents, this operation can take some time. Once complete, the folder and everything within it will no longer be compressed.
The only problem with this approach is that you need to operate on a compressed folder to uncompress it and its contents. If a folder itself is not compressed, but contains many compressed files, you have to multi-select the individual files to perform the operation above.
If you’re not afraid of the command line, however, there is an easier way.
The Compact command
The command-line utility Compact is used to control Windows File Compression. Run “compact /?” in a Windows Command Prompt to see a list of its options.
In that Windows Command Prompt, change directory (CD) to the folder that contains the compressed folder (C:\t in my example) and run “compact /s”.
The “/s” option to compact means operate on all sub-directories as well.
The output shows that in my folder “C:\t”, which is not compressed, is the folder “Example Folder”, which is. In it are several files which are also compressed.
Worth noting is that the Compact command shows the effects of compression and the space saved for each file. Files which are already compressed (like the .jpg files) or files which are already fairly small (like the .doc files) do not benefit from additional compression. Other files, like the .exe file in this example, benefit to varying degrees based on their contents.
Uncompressing using Compact
To uncompress the folder and its contents, simply enter the command “compact /s /u”:
- /s to operate on all sub-directories
- /u to uncompress
A couple of interesting points to note here:
- Compact, by default, operates on the current directory. Because we were “in” C:\t, it tried to uncompress it. Because it was not compressed, nothing needed to be done. Because we specified the “/s” option, it then went on to operate on the contents of the folder.
- Once again, the uncompressing operation took a little time, but each file was listed as it uncompressed.
You may not know where all of your compressed files are. No problem: just run Compact on the entire hard disk.
- You’ll need to run “as” administrator, so this was done within an administrative command prompt.
- There will be errors, as not all files and folders may be accessible. The “/i” switch instructs Compact to ignore errors and proceed anyway.
This should work just fine, but massive operations like this always make me nervous, so I’d strongly suggest backing up completely first and double-checking that you have lots of free space for the files to uncompress into.
Compression: is it useful?
I am not a fan of the built-in Windows disk compression. The technology is sound, but its usefulness has declined over time.
Hard disks are huge and relatively inexpensive these days. Even on older machines, it’s often more effective to add or replace hard disks that it is to enable compression. Particularly on those older machines, compression and decompression take additional CPU resources that could adversely impact your overall performance.
The other thing that’s changed since file system compression was introduced are the files themselves. Many files are compressed already — in fact, many of the very files you might find taking up much of your hard disk space are.
All of your music files (mp3 and other formats), video files (mp4, mov, wmv, and more), and even the latest formats used by Microsoft Office, such as .docx, .xlsx, and similar are already compressed. File system compression will not compress them by much more; in some cases, it can even make them take up a little more space
These days, I advise against using Windows File compression unless you really have no other options.
Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.
I'll see you there!