
By default, there are 3 utility files for dealing with cab files. They are
- makecab.exe
- expand.exe
- extrac32.exe
You can find these in the system32 directory. Each of these have its own story why it's there. makecab and expand utilities are command line versions and extrac32 runs in its own Window. No matter which of them we use, we have to call from the command line(command prompt).
Creating a cab archive
makecab.exe
Open command prompt and type inmakecabThis displays the help screen with details how to call the utility and what parameters to be used


To compress a file, Simply type makecab [filename]
One of the big disadvantage here is that we cannot include multiple files directly. To do that, we have to create a directive file called a Diamond Directive File(DDF) and include instructions in it. To get the whole thing automatically done, use iexpress.exe.
Extracting a cab archive
expand.exe
For help on usage, type in
expand /?


To extract all files in an archive
expand -F:* [filename] [\destination]
Refer the documentation for more details.
extrac32.exe
Unlike expand.exe, this was intended for use with Microsoft Internet Explorer. Later, it became a part of the Windows installation. As this is not a console application, it's not very interactive with command line. Typing 'extrac32' without any parameters will simply load the utility which will terminate immediately.
To read the directives, enter
extrac32 |more


As you can see, there is a lot of facilities with this tool. Try playing around a bit and figure them out.
That's it for native Windows cab tools. Additionally, you may download the Cabinet SDK if you wish to study/utilize more of cabinet files. Most of the time we don't realize we already have the tools we are looking for. These cab tools are just another example. Knowing the tools you already have will someday save you the day.
Post a Comment