WIM extraction

Overview

WIM is Microsoft Windows image format. You can extract such an archive with Aspose.Zip similarly as other archives. It can contain several images, each of them is represented by WimImage class. We can to extract content of the images constituting the archive.

Extract Image

This sample extracts two images of an archive, each to own directory.

1    using (WimArchive wimArchive = new WimArchive("boot.wim"))
2    {
3        wimArchive.Images[0].ExtractToDirectory("extracted0");
4        wimArchive.Images[1].ExtractToDirectory("extracted1");
5    }

Extract Files

This sample extracts each file entry of the first image to the directory.

1    using(WimArchive wimArchive = new WimArchive("boot.wim"))
2    {
3        foreach (WimFileEntry entry in wimArchive.Images[0].AllEntries.OfType<WimFileEntry>())
4        {
5            string entryPath = Path.Combine("extracted", entry.Name);
6            entry.Extract(entryPath);
7        }
8    }
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.