Compressing files via command line on Windows system

I am trying to compress one folder on my local drive, for example: C:\Templates

I am using the following command from the command line (cmd.exe) to perform this operation:

compact /c C:\Templates

      

But it doesn't work and shows the following message:

1 files within 1 directory were compressed.    
0 total bytes of data are stored in 0 bytes.      
The compression ratio is 1.0 to 1.

      

My machine is running Windows 7 64 bit.

+3


source to share


3 answers


Using:

compact /c /s:C:\Templates

      



The only thing you are missing is the switch /s

in front of the directory name.

+6


source


Are you sure the directory is not empty? This will give a message in empty directories. Future files placed there will be compressed.



0


source


By the way, when using compact.exe it does not work if the cluster size exceeds 4096 bytes. I formatted the disk with a cluster size of 8192 bytes and later found out that NTFS compression did not work with it.

0


source







All Articles