General Compress or Uncompress Files and Folders in Windows 11


  • Staff
Compress_banner.png

The NTFS file system volumes support file compression on an individual file basis. The file compression algorithm used by the NTFS file system is Lempel-Ziv compression. This is a lossless compression algorithm, which means that no data is lost when compressing and decompressing the file, as opposed to lossy compression algorithms such as JPEG, where some data is lost each time data compression and decompression occur.

Data compression reduces the size of a file by minimizing redundant data. In a text file, redundant data can be frequently occurring characters, such as the space character, or common vowels, such as the letters e and a; it can also be frequently occurring character strings. Data compression creates a compressed version of a file by minimizing this redundant data.

While NTFS file system compression can save disk space, compressing data can adversely affect performance. NTFS compression has the following performance characteristics. When you copy or move a compressed NTFS file to a different folder, NTFS decompresses the file, copies or moves the file to the new location, and then recompresses the file. This behavior occurs even when the file is copied or moved between folders on the same computer. Compressed files are also expanded before copying over the network, so NTFS compression does not save network bandwidth.

Files or folders saved into an existing compressed folder will automatically be compressed.

NTFS compressed files and folders will have double blue arrows overlay on their icon at the top right corner to indicate that they are compressed.

See also:

This tutorial will show you how to compress or uncompress a file or folder with NTFS Compression in Windows 10 and Windows 11.


A file or folder compressed by NTFS Compression is not the same as a Zipped file or folder.

You will only be able to compress or encrypt (EFS) a file or folder. Not both. As a workaround, you could use BitLocker on the drive to encrypt everything on the drive, and then be able to compress what you want.



Contents



EXAMPLE: Files and Folders compressed using NTFS Compression

NTFS_Compression.png





Option One

Compress or Uncompress File(s) in Properties


1 Right click or press and hold on one or more selected file(s), and click/tap on Properties. (see screenshot below)

Compress_file-1.png

2 In the General tab, click/tap on the Advanced button. (see screenshot below)

Compress_file-2.png

3 Check (compress) or uncheck (uncompress - default) Compress contents to save disk space for what you want, and click/tap on OK. (see screenshot below)

Compress_file-3.png

4 Click/tap on OK. (see screenshot below)

Compress_file-4.png




Option Two

Compress or Uncompress Folder(s) in Properties


1 Right click or press and hold on one or more selected folder(s), and click/tap on Properties. (see screenshot below)

Compress_folder-1.png

2 In the General tab, click/tap on the Advanced button. (see screenshot below)

Compress_folder-2.png

3 Check (compress) or uncheck (uncompress - default) Compress contents to save disk space for what you want, and click/tap on OK. (see screenshot below)

Compress_folder-3.png

4 Click/tap on OK. (see screenshot below)

Compress_folder-4.png

5 Select (dot) Apply changes to this folder only or Apply changes to this folder, subfolders and files for what you want, and click/tap on OK. (see screenshot below)

Compress_folder-5.png




Option Three

Compress File using Command


1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.

2 Type the command below into Windows Terminal, and press Enter. (see screenshot below)

compact /c "<full path of file>" /i /Q

Substitute <full path of file> in the command above with the actual full path of the file you want to compress.

For example: compact /c "C:\Users\Brink\Desktop\File.txt" /i /Q


compress_file_command.png





Option Four

Uncompress File using Command


1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.

2 Type the command below into Windows Terminal, and press Enter. (see screenshot below)

compact /u "<full path of file>" /i /Q

Substitute <full path of file> in the command above with the actual full path of the compressed file you want to uncompress.

For example: compact /u "C:\Users\Brink\Desktop\File.txt" /i /Q


uncompress_file_command.png





Option Five

Compress Folder using Command


1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.

2 Type the command below you want to use into Windows Terminal, and press Enter. (see screenshot below)

(Apply changes to this folder only)​
compact /c "<full path of folder>" /i /Q

OR​

(Apply changes to this folder, subfolders and files)​
compact /c /s:"<full path of folder>" /i /Q

Substitute <full path of folder> in the command above with the actual full path of the folder you want to compress.

For example: compact /c /s:"C:\Users\Brink\Desktop\Folder" /i /Q


compress_folder_and_contents_command.png





Option Six

Uncompress Folder using Command


1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.

2 Type the command below you want to use into Windows Terminal, and press Enter. (see screenshot below)

(Apply changes to this folder only)​
compact /u "<full path of folder>" /i /Q

OR​

(Apply changes to this folder, subfolders and files)​
compact /u /s:"<full path of folder>" /i /Q

Substitute <full path of folder> in the command above with the actual full path of the compressed folder you want to uncompress.

For example: compact /u /s:"C:\Users\Brink\Desktop\Folder" /i /Q


uncompress_folder_and_contents_command.png



That's it,
Shawn Brink


 

Attachments

  • Compress.png
    Compress.png
    1.8 KB · Views: 13
Last edited:

Latest Support Threads

Top Bottom