This guide explains what Windows CAB files are, and includes step-by-step instructions on how to install a CAB file using the Command Prompt, PowerShell, and the DISM tool. This allows you to manually install CAB files to update drivers and install updates or other Windows features.
What is a CAB file?
A CAB (cabinet) file has the file extension .cab and is an archive format used by Windows for distributing software such as updates, drivers, and system components. CAB files take multiple files and store them as a single file to simplify distributing and downloading software.
CAB files are compressed (so they download faster) and can be digitally signed to ensure they haven’t been tampered with and come from a legitimate source. Windows includes native support for extracting CAB files, so no additional software is required.
While Windows updates and driver installations are usually automated, they are also distributed as CAB files that you can also download and install yourself.
You may need to manually install Windows updates or features using CAB files when an automatic update fails or for offline installation in situations where you don’t have an internet connection (typically in secure business environments, not when you’re just going on holiday and can’t tether for a few days or weeks). Device drivers are also often distributed in CAB archives.
Unlike executable MSI files that include installation scripts and additional data for configuring software, CAB files just compress files. This means you can also use CAB files for daily compression tasks, like compressing a folder full of files for archiving or transfer.
What to do before you install Windows features, updates, drivers, or software from CAB files
Before you install any software downloaded from the internet, you should take a full backup of your system in case the installation is not fully successful, has unintended side effects, or contains malware.
You should also make sure you fully understand the impact running any command line commands or scripts will have. This involves reading the documentation for each command or program and making sure you understand what the software you are installing will do.
Verifying a CAB file’s origin and integrity
Before you install or run any software on your PC, you should ensure it is from an official source. You should inspect the legitimacy and reputation of websites you download files from, and, optionally, verify the digital signatures of installers, archives, and executables.
You can verify the integrity of CAB files in Windows by running the following signtool (included as part of Visual Studio) command from the Command Prompt or PowerShell:
signtool verify /pa /v FILENAME.cab
Where FILENAME.cab is the path to the CAB file you wish to verify.
How to extract a CAB file in Windows
In Windows 11 and Windows 10, you can double-click on a CAB file to open it in Windows Explorer and drag files out of it to decompress them.
You also can use the extract command that comes with Windows to extract an entire CAB file. You can use it from the Command Prompt or PowerShell by running:
expand MY_ARCHIVE.cab -F:* DESTINATION_PATH
Replace MY_ARCHIVE.cab with the path to your CAB file and DESTINATION_PATH to the location you want to extract the files. The -F* parameter tells the extract command to extract all files included in the CAB file.
It’s important to note that the extract command does not preserve directories when extracting: all files are extracted to the destination with no subfolders. If you want to retain the structure of the extracted files, you will need to use a third-party tool like 7-Zip:
7z x MY_ARCHIVE.cab -o”DESTINATION_PATH”
This 7-Zip command will extract a CAB file while preserving the original directory structure of the compressed files if it was included. 7-Zip also provides a graphical interface for interacting with compressed files.
Installing CAB files using the DISM (Deployment Image Servicing and Management) tool
The DISM (Deployment Image Servicing and Management) is a built-in Windows command-line tool that can be used to install Windows Updates and features (like language packs or optional Windows features) provided as CAB files.
To install a compatible CAB file using the DISM command, open the Command Prompt as an Administrator and run the following command:
dism /online /add-package /packagepath:MY_FILE.cab
Replace MY_FILE.cab with the path to the required CAB file.
Installing drivers from CAB files using the pnputil tool
You can install drivers directly from CAB files using the following pnputil command (again, from a Command Prompt with Administrative privileges):
pnputil /add-driver MY_FILE.cab /install
This command will add the drivers stored in MY_FILE.cab to the driver store on your Windows system. The /install option tells pnputil to install the driver for compatible hardware once it’s added to the driver store.
You can also extract the contents of the CAB file manually and then use pnputil to install the included driver files individually if you do not wish to install all of them.
Installing Windows features from CAB files using PowerShell
The PowerShell Add-WindowsPackage (part of the DISM tool) cmdlet can be used to install Windows updates and features provided as CAB files:
Add-WindowsPackage -Online -PackagePath “MY_FILE.cab”
Manually installing updates and drivers from CAB files
It’s not possible to install Windows updates or features by manually extracting CAB files and moving the files into place. You can, however, manually extract drivers from CAB files (using the method described above) and then install them using the Device Manager:
- Right-click on the Start button and click Device Manager
- Find the device that requires the driver from the previously extracted CAB file
- Right-click on the device and select Update driver
Uninstalling CAB files
As CAB files are just archives, they cannot be ‘uninstalled’. The files extracted from a CAB archive can simply be deleted. To uninstall a driver that came from a CAB file, locate the device in the Device Manager (as described above), right-click on it, and select Uninstall driver.
If you installed a Windows update or feature using the DISM tool, you can remove it using the Windows Settings App by navigating to Windows Update > Update history > Uninstall updates.
You can also use the DISM tool to do this by running:
dism /online /remove-package /packagename:PACKAGENAME
If you do not know the name of the package, run the following command to list them:
dism /online /get-packages
How to create a CAB file
To archive a single file into a CAB file, use the makecab command:
makecab MY_FILE.txt MY_ARCHIVE.cab
Replace MY_FILE.txt with the path to the file you want to compress and MY_ARCHIVE.cab with the name of the CAB file you want to create.
To compress multiple files into a CAB file, you need to create a directive file with the extension .ddf that lists the files that will be included. You can create this file in Notepad:
.OPTION EXPLICIT
.SET CabinetNameTemplate=MY_ARCHIVE.cab
.SET DiskDirectoryTemplate=.
.SET CompressionType=LZX
.SET MaxDiskSize=0
.SET Cabinet=on
.SET Compress=on
“file1.txt”
“file2.txt”
“folder1\file3.txt”
The lines beginning with .OPTION and .SET are mandatory, and should be followed by the list of files to compress.
Then, run the following command, replacing MY_FILES.ddf with the path to your directive file:
makecab /F MY_FILES.ddf
Note that you don’t need to specify the name of the output CAB file here, as the settings for the output file are specified within the .ddf file.
In addition to the CAB file, a setup.inf file will be created with information about the created CAB file.
Deploying and managing apps, drivers, and updates for multiple Windows PCs
One of the primary use cases for CAB files is deploying Windows updates in enterprise environments. Rather than having hundreds (or thousands) of Windows PCs downloading updates individually from Microsoft’s servers (wasting time and internet bandwidth), and installing at different times, updates can be downloaded once, and deployed to workstations and mobile devices once they have been tested with your hardware and software.
Patch Management by NinjaOne automates Windows updates and updates for third-party software, streamlining their testing and deploying and ensuring a reliable update experience for end-users. You can even roll back failed or problematic patches remotely.
With NinjaOne’s unified remote monitoring and management (RMM) platform, your Windows, Apple, and Android devices can be centrally managed, kept up-to-date, and secured against the latest threats, all without the labor of manually testing and deploying updates to each device.