Cabinet (file format) facts for kids
![]() |
|
Filename extension |
.cab
|
---|---|
Internet media type |
application/vnd.ms-cab-compressed
|
Uniform Type Identifier (UTI) | public.archive.cab |
UTI conformation | public.data public.archive |
Magic number | MSCF |
Developed by | Microsoft |
Type of format | Archive file format |
The Cabinet (or CAB) file is a special type of archive file used by Microsoft Windows. Think of it like a digital box that can hold many computer files together. It helps make files smaller (this is called lossless data compression) and can also include digital certificates to make sure the files haven't been changed.
CAB files usually end with the `.`cab` filename extension. Computers recognize them by a special code at the very beginning of the file, which is "MSCF". These files were first known as Diamond files.
Contents
How CAB Files Are Designed
A CAB archive can hold many different groups of files, called folders. Each of these folders can contain up to 65,535 files. This means a single CAB file can store a huge number of files!
How Files Are Stored
Inside a CAB file, each folder is treated like one big block of compressed data. This helps to make the files even smaller than if each file was compressed on its own.
Because of how they are set up, CAB archives cannot store empty folders. Every entry in a folder must be an actual file.
Here is an example of how files might be organized inside a CAB file:
- CAB file
- First folder
- Records/Student_01.tsv
- Records/Photos/Student_01.jpg
- Second folder
- Records/Student_02.tsv
- Records/Photos/Student_02.jpg
- First folder
Handling File Paths
The CAB file format doesn't strictly say how file paths (like `Records/Photos/`) should be handled. Different programs deal with them in different ways:
- Some programs, like IExpress and Windows File Explorer, treat all files in a CAB archive as if they are in one single folder.
- Other programs, like `CABARC.EXE` and `EXTRACT.EXE` (from Microsoft), can save the original file paths. When you extract the files, these programs will create the necessary folders.
- The `EXPAND.EXE` tool, starting from Windows Vista, can also extract files to their original paths.
Compression Methods Used
CAB files can use different ways to compress data. These are called compression algorithms:
- DEFLATE: This method was created by Phil Katz, who also made the ZIP file format.
- Quantum compression: This method was licensed from David Stafford.
- LZX: This method was invented by Jonathan Forbes and Tomi Poutanen.
- NULL: This means the files are stored without any compression at all.
A CAB archive can also save some empty space inside for special uses. For example, this space might be used for digital signatures or other specific data.
Programs That Use CAB Files
Microsoft Windows has built-in tools to work with CAB files. You can create them using a command-line tool called `makecab`. You can also open and extract files from them using File Explorer, or command-line tools like `expand.exe`, `extract.exe`, and `extrac32.exe`.
Many other popular programs also support CAB files. These include WinZip, WinRAR, and 7-Zip. For Linux systems, `cabextract` is a common tool for getting files out of CAB archives. Another tool called `gcab` can both create and extract CAB files.
How CAB Files Are Used
The CAB format is used by many Microsoft installation technologies. For example, Windows Installer uses CAB files to package software. Internet Explorer also uses them to install ActiveX components.
Sometimes, CAB files are part of programs that can unpack themselves, like IExpress. This means the program itself contains the CAB file and extracts it when you run it. CAB files can also be hidden inside other file types, such as MSI and MSU files.
Windows uses the CAB format to store its system log files, specifically the Component-Based Servicing (CBS) log. This log is usually found in the `C:\Windows\Logs\CBS` folder.
On Linux systems, CAB archives are used by a tool called fwupd. This tool helps to deliver firmware updates from hardware companies, which can then be installed on your computer's non-volatile memory.
Other Formats Called .cab
It's important to know that the `.cab` filename extension is also used by other installer programs. For example, InstallShield uses its own special archive format that also ends with `.cab`. However, these files are not the same as Microsoft CAB files. They use a different way of organizing data, so you can't open them with the same programs.
Special tools, like Unshield, are needed to extract files from InstallShield's `.cab` format. These files have a different "magic number" (a special code at the beginning) which is `ISC(`.
Windows CE installer uses a version of the Microsoft CAB format. It has a "magic number" of `MSCE\0\0\0`. The files inside are often not compressed, but sometimes they use the MSZIP compression method.
Microsoft Publisher has a "Pack and Go" feature. This bundles a Publisher document and all its linked files into a CAB file with a `.PUZ` extension. These `.PUZ` files are meant to be opened with a special `.EXE` file that comes with them. However, you can also open these `.PUZ` files with any program that can extract standard CAB files.
See also
In Spanish: CAB (archivo) para niños
- List of archive formats