WIMEXTRACT(1) | User Commands | WIMEXTRACT(1) |
wimextract - Extract files from a WIM image
wimextract WIMFILE IMAGE [(PATH | @LISTFILE)...] [OPTION...]
wimextract, or equivalently wimlib-imagex extract, extracts one or more files or directory trees from the specified IMAGE contained in the Windows Imaging (WIM) archive WIMFILE.
wimextract is intended for extracting only a subset of a WIM image. If you want to extract or "apply" a full WIM image to a directory or NTFS volume, use wimapply(1) instead.
IMAGE specifies the image in WIMFILE from which to extract the files or directory trees. It may be the 1-based index of an image or the name of an image. It may be omitted if WIMFILE contains only one image. You can use wiminfo(1) to list the images contained in WIMFILE.
If no additional arguments are given, the entire WIM image is extracted. Otherwise, each additional argument is interpreted as a PATH if it does not begin with the '@' character, or a LISTFILE if it does. Each PATH specifies a file or directory tree within the WIM image to extract, whereas each LISTFILE specifies a file that itself contains a list of paths to extract. If a LISTFILE is "-" (i.e. the whole argument is "@-"), then the listfile is read from standard input. See PATHS AND LISTFILES for more details.
By default, files and directories are extracted to the current directory. Use --dest-dir to select a different destination directory. Alternatively, use --to-stdout to extract a file to standard output to pipe into another program.
A file or directory extracted from a PATH argument is by default extracted directly into the destination directory, whereas a file or directory extracted from a LISTFILE argument is by default extracted into the destination directory in such a way that the archive's directory structure is preserved. Use --preserve-dir-structure to always get the latter behavior.
wimextract supports extracting files and directory trees from stand-alone WIMs as well as split WIMs. See SPLIT WIMS.
Each path, including those on the command line and those in listfiles, must be specified as an absolute path starting from the root of the WIM image, like those output by wimdir(1). However, path separators may be either forward or backward slashes, and the leading slash is optional.
On Windows, by default paths are treated case-insensitively, whereas on UNIX-like systems, by default paths are treated case-sensitively. In either case, the default behavior may be overridden through the WIMLIB_IMAGEX_IGNORE_CASE environmental variable, as documented in wimlib-imagex(1).
By default, each path may contain the wildcard characters '?' and '*'. The '?' character matches any non-path-separator character, whereas the '*' character matches zero or more non-path-separator characters. Consequently, a single wildcard path, or "glob", may expand to multiple actual files or directories. Use the --no-globs option to disable wildcard matching and search for each path literally.
Each LISTFILE must be a text file (UTF-8 or UTF-16LE encoded; plain ASCII is also fine) that contains a list of paths to extract, one per line. Wildcard characters are allowed by default. The following demonstrates an example listfile:
; This is a comment (begins with semicolon) # This is also a comment (begins with number sign) /Users /Windows/explorer.exe /Windows/System32/en-US/* ; Both forward and backslashes are valid. ; It's not necessary to quote paths containing internal spaces. \Program Files\A* ; Leading and trailing whitespace is ignored
\Windows\notepad*
You may use wimextract to extract files or directory trees from a split WIM. This uses the --refs="GLOB" option in the same way as in other commands such as wimapply. See wimapply(1) for more details.
See wimapply(1) for information about what data and metadata are extracted on UNIX-like systems versus on Windows.
Reparse-point fixups (a.k.a. changing absolute symbolic links and junctions to point within the extraction location) are never done by wimextract. Use wimapply if you want this behavior.
Unlike wimapply, wimextract does not support extracting files directly to an NTFS volume using libntfs-3g.
Extract a file from the first image in "boot.wim" to the current directory:
wimextract boot.wim 1 /Windows/System32/notepad.exe
Extract a file from the first image in "boot.wim" to standard output:
wimextract boot.wim 1 /Windows/System32/notepad.exe --to-stdout
Extract a file from the first image in "boot.wim" to the specified directory:
wimextract boot.wim 1 /Windows/System32/notepad.exe \
Extract the "sources" directory from the first image in "boot.wim" to the current directory:
wimextract boot.wim 1 /sources
Extract multiple files and directories in one command:
wimextract boot.wim 1 /Windows/Fonts \
Extract many files to the current directory using a wildcard pattern:
wimextract install.wim 1 "/Windows/Fonts/*.ttf"
Extract files using a list file:
wimextract install.wim 1 @files.txt
... where files.txt could be something like:
Windows\System32\*.* Windows\System32\??-??\*.* Windows\System32\en-US\*.*
November 2018 | wimlib 1.13.0 |