Windows Imaging Format (WIM)
What is Windows Imaging Format (WIM)?
Windows Imaging Format (WIM) is used for the creation and distribution of disk image files. First introduced in 2007 to simplify the deployment of Windows Vista, WIM is a file-based disk image format that now serves to simplify and speed up the deployment of later versions of Microsoft operating systems (OS).
With a WIM file, a single disk image can be deployed to multiple computer platforms, which is why the format is mainly used to speed up deployment of file-based disk images.
When there is a need to manage files like updates, drivers or components without having to reboot the OS image, the WIM format is useful. It supports the capture, modification and application of file-based disk images.
WIM: File-based format
Unlike formats like virtual hard disk (VHD) and ISO, WIM is file-based rather than sector-based. The file-based format allows a single file package to contain all package contents, deduplicate multiple instances of the same components, and boot and install faster on a wider range of disk hardware.
Because a single WIM file can also contain multiple disk images, users can install some or all the images depending on what is being distributed. Each image can be referenced by its unique name or numerical index. WIM also supports spanning, so large WIM files can be broken into two or more parts denoted with an .swm extension.
Another advantage of the file-based format is that all required files are stored inside a single WIM file. This reduces the need to individually access various files, minimizing overhead and accelerating image deployment. A single file occupies much less space on the drive compared to multiple image files.
Elements of a WIM file
A single WIM file consists of multiple elements, all distinguishable from each other:
- File header of size 204 bytes.
- Images (one or more).
- Image data file resources (one or more).
Any of these file resources can be included in the WIM file:
Types of Windows Imaging Format file sets
Two types of WIM file sets are available:
1. Single segment WIM file set
A single segment WIM file set has the extension .wim. This file can be used to deploy a Windows OS to new devices. Even though the file captures only a single partition, files from that image can be used to set up the remaining partitions.
There are two ways to capture the .wim file:
- From the install.wim file from a Windows distribution ISO.
- Boot into Windows, then generalize and capture a running Windows image into a .WIM file. This allows the image to be deployed to other devices.
After the image is generalized, it's wise to optimize it, especially if it will be deployed to multiple machines. Image optimization via the DISM /image:C:\ /optimize-image /boot Windows Command Prompt helps reduce device booting time after the image has been applied.
Once the image is captured, the device must be booted using Windows PE (preinstallation environment) and new hard drive partitions must be set up. Finally, the image can be applied using the Windows Command Prompt: D:\ApplyImage.bat D:\Images\Fabrikam.wim.
2. Multi segment WIM file set
A multi segment WIM file set has the extension .swm. You can split a single WIM file into multiple smaller .swm files if Windows OS is being installed from media that can't handle the large size of the WIM file. Examples include digital video discs (DVDs) up to 4.7 GB in size and universal serial bus (USB) keys formatted as FAT32 (maximum size 4 GB).
A WIM file can be split into multiple .swm files by first copying sources\install.wim to the local PC and then splitting the Windows image using the Windows Command Prompt Dism /Split-Image /ImageFile:C:\sources\install.wim /SWMFile:C:\sources\install.swm /FileSize:4700.
At the end of this process, a set of install.swm files will be created in the C:\sources folder. These files cannot be modified. When the WIM file is split into .swm files via DVD deployment, it's best to remove the temporary folder using the Windows Command Prompt rd c:\TempInstallFolder /s /q.
WIM file format users
Three types of users typically use the WIM file format:
1. Windows developers. With a WIM disk image, a Windows developer can package the contents of a complete hard disk drive, with all its files and folders, as a single file. When installed, Windows Setup unpacks that complete disk image to the local computer's hard drive. Large and complex applications can then be installed readily from a single distributable source file.
2. Computer vendors. Computer vendors often use this type of approach to preload a new system with the OS and core applications because it is faster, easier and far less error-prone to copy a single distributable disk image to a new disk rather than perform a complete installation. Because WIM files can be bootable, it's easy to launch Windows Setup and start the installation process the first time a new PC is turned on.
3. Software developers. Software developers, generally using the ImageX tool, also create disk images using the WIM format. The ImageX command-line tool is provided with the Windows Assessment and Deployment Kit (Windows ADK) to edit, create and deploy Windows disk images in the WIM format. The ADK's application programming interface (API) is required to perform the actual Windows installation.
Windows 10 and 11 software developers can use another command-line tool, Microsoft's Deployment Image Servicing and Management (DISM) to create WIM files. Besides servicing a WIM file, DISM can service a VHD (.vhd or .vhdx).
Check out five steps to identify and fix Windows 11 performance issues.
Learn how Windows 11 Print Management can fix printer issues and how to fix Windows 11 when it keeps restarting.
Try these PowerShell Start-Job examples for more efficiency and these seven steps to fix a black screen in Windows.