Skip to main content

Making and Extracting CAB files in Windows

Cabinet files(a.k.a. Diamond files) are the Microsoft Windows Archives. These archives can store multiple files/folders into a single file with or without involving data compression. Since every Windows system is natively compatible with cab files, Windows provide enough facilities to create, extract, or rebuild cab files without requiring additional software.


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 in
makecab
This 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]
Compressed cabinet file will be saved in the same directory of the source file.

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.

Comments

Post a Comment

Popular posts from this blog

Why Canned Salmon Got Soft Bones

Canned Salmon is a nutritious food, especially for protein and calcium. You can eat it right out of the tin. The fish bones are very soft and tender that they can hardly be noticed. It is a good source of easily digested and absorbed Calcium. But what made them so soft? Is it really safe to eat? because fresh Salmon bones look nothing like it!

Why Atmosphere is Thicker at Equator

Atmosphere is the layer of gases that surrounds the Earth retained by Earth's gravity. Have you ever come across the question; what is the shape of the atmosphere? It's fair to think that the atmosphere is shaped somewhat like the Earth itself. because of gravity. We know that the Earth is not a perfect sphere. So, We can assume atmosphere to have a similar shape. But amazingly, the shape of the Atmosphere is affected by a lot of factors and the deformation is even more. Lets see why that is..