MAKECAB.exe – Windows CMD Command

Create compressed .CAB file. A .CAB Cabinet file is a Lossless Data Compression format.

Syntax
      MAKECAB [/V[n]] [/D var=value ...] [/L dir] source [destination]

      MAKECAB [/V[n]] [/D var=value ...] /F directive_file [...]

Key
   source         File to compress.

   destination    File name to give compressed file.  If omitted, the
                  last character of the source file name is replaced
                  with an underscore (_) and used as the destination.

   /F directives  A file containing directives for MAKECAB to use (may be repeated).
                  If more than one directive file is specified (/F file1 /F file2 ...), they
                  are processed in the order (left to right) specified on the command line.

                  Variable settings, open cabinets, open disks, etc. are all carried forward
                  from one directive file to the next (just as if all of the files had been
                  concatenated together and presented as a single file to MakeCAB).
                  For example, this is intended to simplify the work for a product shipped in
                  multiple languages. There would be a short, language-specific directives file, 
                  and then a single, master directives file that covers the bulk of the product.

   /D var=value   Defines variable with specified value. (may be repeated).
                  Equivalent to using .Set in a directives file.
                  For example, a single directive file could be used to produce layouts
                  for different disk sizes by running MakeCAB once with different values of
                  MaxDiskSize defined: /D MaxDiskSize=1.44M. Both standard MakeCAB variables
                  and custom variables can be defined in this way.

                  If .Option Explicit is specified in a directive file,
                  then variable must be defined with a .Define command in a directive file.
                  To use a variable substitution (as in the directive file with %)
                  use double %%

   /L dir         Folder location to place destination file (default is current directory).
                  most useful when destination is not specified.

   /V[n]          Verbosity level (1..3)  1=default, 3=Verbose. ( 0=none undocumented )

A single CAB file can be used to store a maximum of 65,535 files with a total size of up to 1.99 GiB. To compress multiple files into a single CAB file, use a directive file containing a list of the files to compress and package.

The default destination name is constructed from the source file name plus an extension that can be defined via the CompressedFileExtensionChar variable. ( MAKECAB /D CompressedFileExtensionChar=c )

The MakeCAB defaults are configured for a floppy disk layout.

Examples

Create a .CAB archive containing a single file:

C:\> makecab "recording.wav" "recording.cab" /L "C:\Archive"

Create a .CAB archive containing multiple files, first create F4T.ddf as a plain text file:

.OPTION EXPLICIT
;    CabinetNameTemplate is the name of the output CAB file:
.Set CabinetNameTemplate=Destination.CAB
.Set Cabinet=on
.Set Compress=on
"file1.dat"
"file2.iso"
"file3.wav"

C:\> makecab /F F4T.ddf
Create a self extracting archive containing movie.mov:

C:\> makecab movie.mov "temp.cab"
C:\> copy /b "%windir%\system32\extrac32.exe"+"temp.cab" "movie.exe"
C:\> del /q /f "temp.cab"F4TExamples

Create a .CAB archive containing a single file:

C:\> makecab "recording.wav" "recording.cab" /L "C:\Archive"

Create a .CAB archive containing multiple files, first create F4T.ddf as a plain text file:

.OPTION EXPLICIT
;    CabinetNameTemplate is the name of the output CAB file:
.Set CabinetNameTemplate=Destination.CAB
.Set Cabinet=on
.Set Compress=on
"file1.dat"
"file2.iso"
"file3.wav"

C:\> makecab /F SS64.ddf
Create a self extracting archive containing movie.mov:

C:\> makecab movie.mov "temp.cab"
C:\> copy /b "%windir%\system32\extrac32.exe"+"temp.cab" "movie.exe"
C:\> del /q /f "temp.cab"

You may also like...

3 Responses

  1. lasixginty says:

    I am not sure where you’re getting your information, but great topic. I needs to spend some time learning much more or understanding more.
    Thanks for wonderful info I was looking for this info for my mission.

  2. Alvin Desmeules says:

    outstanding blog

  3. Gary says:

    Thanks for ones marvelous posting! I actually enjoyed reading it, you may be a great author.
    I will make certain to bookmark your blog and will eventually come back down the road.
    I want to encourage you continue your great job, have a nice morning!

Leave a Reply

Your email address will not be published. Required fields are marked *