0

I want to compress a 13 mb file. I run the following cmd and it is successful (as as I can tell) but no new zip file appears.

D:\>compact D:\myfile.bak

 Listing D:\myDir\
 New files added to this directory will not be compressed.

 13728256 :   4874240 = 2.8 to 1 C myFile.bak

Of 1 files within 1 directories
1 are compressed and 0 are not compressed.
13,728,256 total bytes of data are stored in 4,874,240 bytes.
The compression ratio is 2.8 to 1.

Am I not including switch or is the file going somewhere else?

Kara
  • 6,115
  • 16
  • 50
  • 57
Fearghal
  • 10,569
  • 17
  • 55
  • 97
  • 1
    Based on the output of `compact /?`, I'm getting the impression that myFile.bak is simply compressed in place. What is the current size of the file? – SomethingDark Aug 02 '16 at 17:13
  • 1
    Um... Compact is not a zip file creator. It alters compression of files within the NTFS file system (which is why it says *New files added to this directory*). Type `compact /?` from a command prompt, or see [the documentation](https://technet.microsoft.com/en-us/library/cc726045.aspx). You're confusing it with WinZip or 7zip. – Ken White Aug 02 '16 at 17:20
  • Darn. either way it doesnt reduce the size so il have to go back to zip. Do you know if there is a zip app that does not need installation - my issue is its not my server so i dont want to install or reboot in order to enable zipping – Fearghal Aug 02 '16 at 17:24
  • Both WinRAR and 7Zip should be portable. At least, rar.exe is standalone, so I can't imagine 7Zip doesn't also have a standalone version. – SomethingDark Aug 02 '16 at 17:49
  • 1
    @Fearghal A file stored compressed on an NTFS drive is indeed ZIP compressed, but it keeps its original name and NTFS file system returns size of uncompressed file. For example create an empty folder `C:\Temp\Test` and copy your file into this folder. Right click on folder `C:\Temp\Test` and look on value for size on storage media. Now click on button Advanced, check to compress the folder and click on OK. After confirmation of compressing (compacting) all files in the folder, look again on value for size on storage media. The value is much smaller if file contains not already compressed data. – Mofi Aug 02 '16 at 18:34
  • compact command is not what you searching for.Better [check thiz](http://stackoverflow.com/questions/28043589/how-can-i-compress-zip-and-uncompress-unzip-files-and-folders-with-bat) – npocmaka Aug 02 '16 at 19:26

0 Answers0