Delen via


DISM configuration list files

A DISM configuration list enables you to customize specific compression, capture, and boundary alignment actions for each file and folder when you capture an image using DISM. The DISM configuration list file is typically called WimScript.ini.

You can use DISM's /ConfigFile option to specify a configuration list file that define:

  • Which files and folders must be excluded from the capture process when you run DISM /Capture-Image.
  • Which folders, files, and file types must be excluded from the compression process when you use the /Compress argument.

Creating a configuration list file

A configuration list file is a text file with as many as three sections. Each section lets you define what should happen with different file types when you capture an image. You can create a configuration list (.ini) file by using a text editor, such as Notepad.

The following sections appear in the DISM configuration list file. Add new lines in the relevant section for each files or folder you want to exclude.

Section Description
[ExclusionList] Enables you to define the files and folders to exclude when you use the /Capture-Image option.
[ExclusionException] Enables you to override the default exclusion list when you use the /Capture-Image option.
[CompressionExclusionList] Enables you to define the specific files and folders, and also to specify file types, to exclude when you use the /Compress argument.

Note

You can use file or folder matching to exclude a file from compression. You can provide a full path match, or you can use wildcard characters (). For example, you can use \WINDOWS\inf.pnf to match a specific type of file, or \WINDOWS\inf* to match a whole folder.

Default Exclusion List

By default, DISM excludes the following files:

[ExclusionList]
\$ntfs.log
\hiberfil.sys
\pagefile.sys
\swapfile.sys
\System Volume Information
\RECYCLER
\Windows\CSC

[CompressionExclusionList]
*.mp3
*.zip
*.cab
\WINDOWS\inf\*.pnf

Exclusion List Guidelines

  • You can only use wildcard characters in the last component in a file path that does not begin with a backslash. For example:

    myfolder\*.txt
    
  • You can use a preceding backslash to limit file-matching and directory-matching relative to the root directory. For example, you can use this exclusion list:

    \myfolder
    \folder\subfolder
    

    This list will exclude the following files and directories when you capture the "C:\" drive:

    C:\myfolder
    C:\folder\subfolder
    

    However, DISM will not exclude files or directories that are contained in the following example.

    C:\main\myfolder
    C:\data\folder\subfolder
    
  • You can override the default exclusion list by using the [ExclusionException] section. For example:

    [ExclusionException]
    \pagefile.sys
    \System Volume Information
    
  • If an explicit [ExclusionException] section is provided in the WIM configuration file, it always takes precedence over the [Exclusion List] section.

  • You can't override the default compression exclusion list by using the [ExclusionException] section.

Using the Configuration File

If you create a custom-named configuration file and store it outside the DISM directory, you can use the DISM command to run the file. At a command prompt, open the DISM directory. For example:

Dism /Capture-Image /ImageFile:install.wim /CaptureDir:D:\ /Name:Drive-D /ConfigFile:WimScript.ini

or

Dism /Append-Image /ImageFile:install.wim /CaptureDir:D:\ /Name:Drive-D /ConfigFile:<configuration list>

where <configuration list> provides the complete directory location for the configuration file. For example, C:\imaging\configuration_list.ini. You must use either the /Capture-Image option to create a new .wim file or the /Append-Image option to append an existing .wim file.

DISM Image Management Command-Line Options