In this article, we will see how to enable NTFS compression for files and folders in Windows 10. Unlike ZIP file compression, with this compression type, you do not need to create an archive file. Compression will happen on-the-fly and the files can be accessed transparently as they were before compressing. Windows 10 supports NTFS compression natively like previous versions of Windows.
NTFS compression makes certain files and folders smaller. Certain files like images, videos, music which are already compressed won't be shrunk but for other file types, it can save you disk space. But keep in mind that it affects performance. This is because of extra operations the OS has to perform when the file is accessed, copied out of a compressed folder or put inside a new compressed folder. During these operations, Windows has to decompress the file in memory. As it follows from the name of the feature, NTFS compression doesn't work when you copy your compressed files over the network, so the OS has to decompress them first and transfer them uncompressed.
When a file or folder is compressed, Windows 10 displays a special double blue arrows overlay over their icon. See the following example.
Tip: If you are not happy to see this overlay icon, see how to Disable blue arrows icon on folders and files in Windows 10.
If saving disk space is your priority goal, here is how to enable NTFS compression in Windows 10.
To compress files and folders in Windows 10, do the following.
- Right click the file or folder you want to compress and select "Properties".
- On the General tab in Properties, click the button Advanced.
- In the next window, tick the check box Compress contents to save disk space under the Compress or Encrypt attributes section.
- Click OK to close the Advanced properties window. If you selected a folder, the following dialog will appear:
There, you need to choose "Apply changes to this folder only" or "Apply changes to this folder, subfolders and files". Select the required option.
To uncompress the file or folder, untick the checkbox Compress contents to save disk space using the sequence described above and you are done.
Windows 10 comes with a console utility "compact" which can be used to compress individual files and folders.
Compress files and folders in Windows 10 with Compact
The compact.exe app supports the following command line switches and options.
/C Compresses the specified files. Directories will be marked
so that files added afterward will be compressed unless /EXE
/U Uncompresses the specified files. Directories will be marked
so that files added afterward will not be compressed. If
/EXE is specified, only files compressed as executables will
be uncompressed; if this is omitted, only NTFS compressed
files will be uncompressed.
/S Performs the specified operation on files in the given
directory and all subdirectories. Default "dir" is the
/A Displays files with the hidden or system attributes. These
files are omitted by default.
/I Continues performing the specified operation even after errors
have occurred. By default, COMPACT stops when an error is
/F Forces the compress operation on all specified files, even
those which are already compressed. Already-compressed files
are skipped by default.
/Q Reports only the most essential information.
/EXE Use compression optimized for executable files which are read
frequently and not modified. Supported algorithms are:
XPRESS4K (fastest) (default)
LZX (most compact)
/CompactOs Set or query the system's compression state. Supported options are:
query - Query the system's Compact state.
always - Compress all OS binaries and set the system state to Compact
which remains unless administrator changes it.
never - Uncompress all OS binaries and set the system state to non
Compact which remains unless administrator changes it.
/WinDir Used with /CompactOs:query, when querying the offline OS. Specifies
the directory where Windows is installed.
filename Specifies a pattern, file, or directory.
Run the app without parameters to see the compression state of the current directory and any files it contains.
To compress a single file, execute the command:
compact /c "full path of file"
compact /u "full path of file"
See the following screenshot.
Here is how to compress a folder:
compact /c "full path of folder"
To compress the whole contents of the folder, use the command:
compact /c /s:"full path of folder"
To uncompress only the specified folder without subfolders, run the command
compact /u "full path of folder"
To do the same for the folder and all its sudfolders, run the command:
compact /u /s:"full path of folder"
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options: