Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
WIMEXTRACT(1)			  User Commands 		   WIMEXTRACT(1)

NAME
     wimextract - Extract files from a WIM image

SYNOPSIS
     wimextract WIMFILE IMAGE [(PATH | @LISTFILE)...]  [OPTION...]

DESCRIPTION
     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 di-
     rectory 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 speci-
     fies 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 ex-
     tracted from a LISTFILE argument is by default extracted into the	destina-
     tion directory in such a way that the archive's directory structure is pre-
     served.  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.

PATHS AND LISTFILES
     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 ei-
     ther case, the default behavior may be overridden	through  the  WIMLIB_IM-
     AGEX_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.   Conse-
     quently,  a  single wildcard path, or "glob", may expand to multiple actual
     files or directories.  Use the --no-globs option to disable wildcard match-
     ing 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*

SPLIT WIMS
     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  com-
     mands such as wimapply.  See wimapply(1) for more details.

OPTIONS
     --check
	   Before  extracting  the  files, verify the integrity of WIMFILE if it
	   contains extra integrity information.

     --ref="GLOB"
	   File glob of additional WIMs or split  WIM  parts  to  reference  re-
	   sources  from.   See  SPLIT_WIMS.  Note: GLOB is listed in quotes be-
	   cause it is interpreted by wimextract and may need to  be  quoted  to
	   protect against shell expansion.

     --dest-dir=DIR
	   Extract  the files and directories to the directory DIR instead of to
	   the current working directory.

     --to-stdout
	   Extract the files to standard output instead of  to	the  filesystem.
	   This  can  only be provided if all the specified paths are to regular
	   files (not directories or reparse points).  If  present,  named  data
	   streams are not extracted.

     --unix-data
	   See the documentation for this option to wimapply(1).

     --no-acls
	   See the documentation for this option to wimapply(1).

     --strict-acls
	   See the documentation for this option to wimapply(1).

     --no-attributes
	   See the documentation for this option to wimapply(1).

     --include-invalid-names
	   See the documentation for this option to wimapply(1).

     --no-globs
	   Do  not  recognize  wildcard  characters in paths.  Each path will be
	   searched for literally.  In addition, if case  insensitivity  is  en-
	   abled,  do  not  allow a single path to match multiple files with the
	   same case-insensitive name but different case-sensitive names.

	   --no-wildcards is also accepted as an alias for this option.

     --nullglob
	   If a glob does not match any files, ignore it and print a warning in-
	   stead of failing with an error.  In other words, this option allows a
	   glob to successfully match zero files.

	   This option also affects paths that do not contain  wildcard  charac-
	   ters,  since  such paths are still considered globs unless --no-globs
	   is enabled.	If case-insensitivity is  enabled,  such  a  glob  could
	   match  multiple files with the same case-insensitive name but differ-
	   ent case-sensitive names, whereas a non-glob path  (with  --no-globs)
	   can match at most one file.

     --preserve-dir-structure
	   When  extracting  paths, preserve the archive directory structure in-
	   stead of extracting the file or directory tree named by each path di-
	   rectly to the destination directory.  Note:	--preserve-dir-structure
	   is already the default behavior for paths in listfiles, but not paths
	   directly specified on the command line.

     --wimboot
	   See the documentation for this option to wimapply(1).

     --compact=FORMAT
	   See the documentation for this option to wimapply(1).

     --recover-data
	   See the documentation for this option to wimapply(1).

NOTES
     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.

EXAMPLES
     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 direc-
     tory:

	    wimextract boot.wim 1 /Windows/System32/notepad.exe \
		   --dest-dir=somedir

     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 \
		   /sources /Windows/System32/cmd.exe

     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\*.*

SEE ALSO
     wimlib-imagex(1) wimapply(1) wimdir(1) wiminfo(1)

wimlib 1.14.4			  February 2024 		   WIMEXTRACT(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=wimlib-imagex-extract&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help