iSumsoft » Resources »computer » 2 Ways to Compress or Decompress Files and Folders

2 Ways to Compress/Decompress Files and Folders on a Windows PC

When your hard drive is out of space, but you don't want to delete some files and folders, as it's may be important, your best choice is to compress files to free up space. This post will show you how to compress or decompress files and folders on a Windows PC.

When your hard drive is out of space, but you don't want to delete certain files and folders, as it may be important, your best bet is to compress the file to free up space. This article will show you how to compress or unzip files and folders on a Windows PC.


Compress/Uncompress Files with Windows File Compression

Windows File Compression is a part of the NTFS file system, it'll automatically compress files to take up less space on the disk when enabling this feature, you can compress an individual file and an entire folder.

Step 1: In Windows/File Explorer, right-click the folder and click Properties.

Open file Properties

Step 2: In the General tab, click on the Advanced button.

Click Advanced button

Step 3: To check on Compress contents to save disk space box, and click on OK.

Select compress contents to save disk space

Tips: Decompressing compressed files and folders with Windows File Compression

To decompress this folder uncheck Compress contents to save disk space box.

Decompress files and folders

Step 4: Click Apply button, then select to Apply changes to this folder only or Apply changes to this folder, subfolders, and files, and click on OK.

Apply changes to all subfolders and files

Compress/Uncompress Files and Folders with Command Prompt

You can select to compress or decompress files and folders via command. And you need to know the full path of that file and folder see 2 ways to get the full path of files and folders.

View the location of files and folder

Step 1: Press Win + X keys to open a Command Prompt.

Open Command Prompt

Step 2: Execute the following commands to compress or decompress, and press Enter key.

Compress a file or only a folder Command:

  • To compress a file: compact /c "full path of file" /I /Q ( see in screenshots below )
  • To compress only a folder: compact /c "full path of folder" /I /Q

Such as I want to decompress a text file in desktop, execute the command like this: compact /c "C:\Users\emily\Desktop\file.txt" /I /Q

Compress a file and folder

Decompress a file or only a folder:

  • To uncompress a file: compact /u "full path of file" /I /Q
  • To uncompress only a folder: compact /u "full path of folder" /I /Q

Uncompress a filer

Compress a folder and its content: compact /c/s "full path of file" /I /Q

e.g. To compress New Folder and its contents: compact /c/s "C:\Users\emily\Desktop\New Folder" /I /Q

Compress a folderand its contents

Decompress a folder and its content: compact /u /s: "full path of folder" /i /Q

e.g. To uncompress a folder named usb, execute command: compact /u "C:\Users\emily\Desktop\usb" /i /Q

Uncompress a folder and its contents

Step 3: When you have done, close Command Prompt Window.

The meaning of letters in command, you may want to know:

/c Compresses the specified files. Directories will be marked so that files added afterward will be compressed.

/u Decompresses the specified files.

/s Perform the specified operation on files in the given directory and all subdirectories.

/a Display files with the hidden or system attributes.

/I Continues performing the specified operation even after errors have occurred.

/Q Reports only the most essential information.