WIMUPDATE(1)
π WIMUPDATE β the manual page but make it cute
okay so bestie, welcome to wimupdate, from the User Commands section, aka WIMUPDATE(1). it's the whole vibe of "i want to change a WIM image and i want to do it from the command line." let's get into it π
β¨ NAME β¨
wimupdate β Update a WIM image
πΈ SYNOPSIS πΈ
wimupdate WIMFILE [IMAGE] [OPTION...] [< CMDFILE]
π¦ DESCRIPTION π¦
so wimupdate, or literally the exact same thing as wimlib-imagex update, modifies the specified IMAGE in the Windows Imaging (WIM) archive WIMFILE by adding, deleting, or renaming files or directories in it. that's the whole job. she does one thing and she does it well. π
IMAGE is like, which image inside WIMFILE you want to update. it can be either:
- the 1-based index of an image, or
- the name of an image.
and you can straight up skip it if WIMFILE only has one image in it (one-image WIMs stay winning). if you need to see what images are even in there, run wiminfo(1) and she'll list them for you. π
now here's the main character part: the modifications you want to perform are specified as a sequence of commands, one per line, read from standard input as a text file. that file can be UTF-8 or UTF-16LE encoded, and plain ASCII is also fine btw, no stress.
π‘ bestie please redirect standard input from a file (CMDFILE) like the synopsis shows, instead of typing commands in interactively. i'm begging. it's so much nicer.
oh and if you want to just specify one single command directly on the command line instead, go look at the --command option. iykyk. β¨
π AVAILABLE COMMANDS π
this section is all about the commands that can show up in the CMDFILE we were just talking about. let's go one by one, no skipping. π
π add [OPTION...] SOURCE DESTINATION
add a file or a whole directory tree to the WIM image. the deets:
- SOURCE has to be the path to a file or directory on your own filesystem.
- DESTINATION has to be the path inside the WIM image where you want that file or directory tree to land.
now, the branching logic, and yes it matters:
- if DESTINATION names an existing directory in the WIM image, then SOURCE must also name a directory. this makes the contents of the SOURCE directory get added into the DESTINATION directory. (contents, not the dir itself. important.)
- if DESTINATION names an existing nondirectory file in the WIM image, then SOURCE must also name a nondirectory file. by default this causes the DESTINATION file to be replaced with the SOURCE file. or, if you pass
--no-replace, it generates an error instead. your call bestie. - if DESTINATION doesn't exist in the WIM image at all, then any prerequisite directories are created as needed to put SOURCE at that location. she builds the road as she drives. π£οΈ
the add command supports a subset of the options that wimcapture accepts, namely: --dereference, --unix-data, --no-acls, and --strict-acls. see wimcapture(1) for what those actually do.
on top of that, add also supports the --no-replace option, which makes add refuse to overwrite existing nondirectory files in the WIM image. so polite of her. π
π§ delete [OPTION...] PATH
delete a file or directory tree from the WIM image. PATH must specify the path inside the WIM image of the file or directory tree you want gone. bye bye π«Ά
the available options for the delete command are:
--forceβ do not issue an error if the path to delete does not exist. (like, if it's already gone, whatever, we move on.)--recursiveβ delete the file or directory tree recursively. if you don't specify this, an error is issued if the path to delete is a directory. she's not gonna nuke a whole tree without your explicit consent, and honestly? respect.
π rename OLD_PATH NEW_PATH
rename a file or directory tree inside the WIM image.
- OLD_PATH = the old path of the file or directory tree inside the WIM image.
- NEW_PATH = the new path for that file or directory tree.
this command follows the semantics of the POSIX rename (3) function. in particular, a pre-existing file at NEW_PATH will be deleted if present β except in certain cases, like attempting to rename a directory to a non-directory, which is not allowed. so watch out for that one. π
and: there are no options available for the rename command. she's a no-frills icon. periodt.
π OPTIONS π
these are the options wimupdate itself accepts on the command line. sit down, there's a bunch, and we're doing all of them. β
--dereferenceβ use--dereferencefor alladdcommands.--unix-dataβ use--unix-datafor alladdcommands.--no-aclsβ use--no-aclsfor alladdcommands.--strict-aclsβ use--strict-aclsfor alladdcommands.--no-replaceβ use--no-replacefor alladdcommands.--config=FILEβ set the capture configuration file for alladdcommands. see the description of this option inwimcapture(1).--forceβ use--forcefor alldeletecommands.--recursiveβ use--recursivefor alldeletecommands.--checkβ before updating the WIM, verify its integrity if it contains extra integrity information. also, include extra integrity information in the updated WIM even if it wasn't there before. double duty. π--include-integrityβ include extra integrity information in the updated WIM, i.e. like--checkbut don't also verify the WIM beforehand.--threads=NUM_THREADSβ number of threads to use for compressing newly added files. default: autodetect (number of processors). let her cook on as many cores as she can find. π₯--rebuildβ rebuild the entire WIM rather than appending the updated data to the end of it. rebuilding the WIM is slower, but it will save a little bit of space that would otherwise be left as a hole in the WIM file.
also, see wimoptimize(1) for a more customizable way of rebuilding (and optionally recompressing) a WIM file. and heads up: if you're running wimoptimize after wimupdate, there is no need to specify --rebuild to wimupdate. don't do both, that's just doing it twice for no reason bestie.
--command=STRINGβ instead of reading update commands from standard input, read a single update command directly from the string STRING specified on the command line.
rules of this one:
- this option cannot be provided more than one time
- and it cannot be used to specify more than one update command
note that the STRING, as well as any paths containing spaces within the STRING, must be appropriately quoted. if you're running from cmd.exe on Windows, you should use double quotes for the outer quotes and single quotes for the inner quotes. example:
wimupdate boot.wim 1 --command="add 'C:\My Dir' '\My Dir'"
π¨ this option is provided for convenience only. do NOT executewimupdatemultiple consecutive times, each time passing the--commandoption! that is inefficient. instead, generate an update command file and provide it (on standard input) to a single invocation ofwimupdate, as explained in this document. one and done, like a queen. π
--wimboot-config=FILEβ if this option is specified, no commands shall be read from standard input, and instead the following command shall be executed:
add FILE /Windows/System32/WimBootCompress.ini
this sets FILE as the WIMBoot configuration file for the image. the [PrepopulateList] section of this file specifies path globs that shall not be extracted as WIMBoot pointer files (perhaps due to being needed early in the boot process). see the documentation for the --wimboot option of wimapply(1) for more information.
--unsafe-compactβ compact the WIM archive in-place and append any new data, eliminating "holes". this is efficient, but in general this option should not be used because a failed or interrupted compaction will corrupt the WIM archive. π for more information, see the documentation for this option inwimoptimize(1).
β οΈ like, she literally has "unsafe" in the name. the name is not a vibe, it's a warning. you've been told. π
--ref="GLOB"β file glob of WIM(s) on which the delta WIM is based. updating split WIMs is not allowed, but updating delta WIMs is allowed. when updating a delta WIM, the WIM(s) on which the delta WIM is based should be specified using this option. (it isn't a hard requirement, but it's needed for data deduplication to work fully and for the TOTALBYTES statistic to be correctly updated.)
π«Ά NOTES π«Ά
okay, the notes section, aka the "bestie pls read this part" part. π
wimupdate can be viewed as redundant with wimmountrw, since a WIM image can also be updated by mounting it read-write. HOWEVER β and this is the slay β wimupdate works on all platforms including Windows, whereas wimmountrw only works on Linux. so if you're on Windows, she's the one. π
symbolic links inside a WIM image are not dereferenced when being interpreted. so, for example, if you have a WIM image that contains a symbolic link "/Documents and Settings" -> "/Users" where "/Users" is a directory, then a subdirectory named "Public" in this directory must be specified as "/Users/Public" rather than "/Documents and Settings/Public". yes, you have to spell it out the long way. she is not following the link for you. π
all paths to files or directories within the WIM image must be specified relative to the root of the image. but, good news:
- the leading slash is optional
- and both forward slashes and backslashes are accepted β so
/or\, she doesn't care, she's flexible like that
in addition:
- on Windows, paths are by default treated case-insensitively
- on UNIX-like systems, paths are by default treated case-sensitively
the default case sensitivity may be changed by setting the WIMLIB_IMAGEX_IGNORE_CASE environmental variable to 0 or 1. so you do have the switch, bestie. π
the command file (CMDFILE) is parsed by wimupdate itself and not by the system shell. therefore, its syntax is limited. however:
- comment lines beginning with
'#'are allowed - and it is also possible to quote arguments with whitespace inside them
so it's limited but not that limited. she's got range. β¨
on UNIX-like systems, you cannot use wimupdate to add files to an image directly from an NTFS volume using libntfs-3g, even though wimcapture supports capturing a full image this way. yeah. that's just how it is. π
and finally, the safety note, listen up:
except when using--unsafe-compact, it is safe to abort awimupdatecommand partway through. however, after doing this, it is recommended to runwimoptimizeto remove any data that was appended to the physical WIM file but not yet incorporated into the structure of the WIM β unless--rebuildwas specified, in which case you should delete the temporary file left over. πΈ
so like. aborting is fine. but clean up after yourself. we're not messy in this house. π
π« EXAMPLES π«
Okay bestie, every single example down here shows you both things at once: the update command file you're gonna create, and the wimupdate command you run to actually make those updates happen. Two-for-one, we love that for us. π
ποΈ Deleting two files from a WIM image
update_commands.txt:
delete /setup.exe
delete /sources/setup.exe
Then run it:
$ wimupdate boot.wim 2 < update_commands.txt
π₯ Adding some files and directories to a WIM image
Heads up bestie: the first path of each add command is the stuff you're adding, and the second path of each add command is where inside the WIM image it's gonna land. Two paths, two jobs, no confusion. β¨
update_commands.txt:
add somedir /dir
add somefile /dir/file
Then:
$ wimupdate boot.wim 2 < update_commands.txt
βοΈ Renaming a file inside a WIM image
update_commands.txt:
rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
Then:
$ wimupdate boot.wim 2 < update_commands.txt
π The glow-up example: comments, options, overlays, and extra integrity info
This one is the main character, fr fr. It uses additional features like comments, options, and overlays β and it even sneaks extra integrity information into the updated WIM. π
update_commands.txt:
#
# This file specifies some changes to make to a WIM image.
#
# Add a new directory containing files I want in the image.
# The quotes are necessary because the directory name
# contains a space.
add "My Directory" "/My Directory"
# Add the contents of "Another Directory" to the
# "/My Directory" we just created in the WIM image. Since
# the destination path already exists, this performs an
# overlay.
add "Another Directory" "/My Directory"
# Rename some file for some reason.
rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
# Delete an unwanted directory.
delete --recursive /Users/Me/Documents/Junk
And the run β peep the --check flag, she's doing the most (in a good way) π«Ά:
$ wimupdate boot.wim 2 --check < update_commands.txt
π SEE ALSO π
wimlib-imagex(1) wimcapture(1) wiminfo(1) wimmountrw(1) wimoptimize(1)
That's the whole page, bestie!! π¦ You made it to the end and I'm so proud of you. This beauty is from wimlib 1.14.5, dated January 2026, and she lives under the name WIMUPDATE(1). Go update some WIMs, you absolute icon. πβ¨π
π¦ where this page comes from
- arch rolling: wimlib 1.14.5-4 Β· LGPL-2.1-only OR LGPL-3.0-only
- fedora 43: wimlib-utils 1.14.5-1.fc43 Β· GPL-3.0-or-later AND MIT
- fedora 44: wimlib-utils 1.14.5-1.fc44 Β· GPL-3.0-or-later AND MIT
- nixpkgs unstable: wimlib 1.14.5
- ubuntu resolute: wimtools 1.14.5-1 Β· GPL3.0+-with-exception
- ubuntu stonking: wimtools 1.14.5-1build1 Β· GPL3.0+-with-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms