MakeCab : Part 2 - Compress multiple files
To compress multiple files into a single CAB file, you need to use a directive file.
The directive file contain instruction how MakeCab should compress and package the files.
Below is a sample of the most basic directive file. Replace the file list with your actual files.
.OPTION EXPLICIT
.Set CabinetNameTemplate=mycab.CAB
.Set Cabinet=on
.Set Compress=on
"file1.pdf"
"file2.doc"
"This is a third file.doc"
All directive start with ".". Comment start with ";".
In the above example,
option explicit specify all variables must be declared before it is used.
CabinetNameTemplate specify the name of the output CAB file.
Cabinet specify whether include the files in the CAB file. When creating setup package, you can use this directive to exclude certain file such as setup.exe from being included into the CAB file.
Compress specify whether to compress the file.
The remaining lines specify the files to be included into the CAB file.
To compress the files using the directive file, run the following command:
makecab /f your_directive_file.ddf.
Once completed, the CAB file will be created inside a folder named "disk1". Two more files, setup.inf and setup.rpt is also created. You can just take the CAB file and ignore the others.
5 Comments:
Do not use " around file name, it does not work.
It does work for me. use it in Notepad, and encode it as ANSI.
Thanks alot the ddf file worked wonders. now i can pack the instructions for our windows mobiles to set all the vallues for the exchange sync
I was wondering how to tar files in windows ,makecab is the solution
I was wondering tar like command in windows,makecab is the solution
Post a Comment
<< Home