Create an ImageX Configuration File

Applies To: Windows 7

Note

This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.

ImageX is a command-line tool that enables the creation of image files for deployment in a manufacturing or corporate IT environment. You can create a configuration file (configuration_list.ini) to determine:

  • Which files and folders must be excluded from the capture process when using the /capture option.

  • Which folders, files, and file types must be excluded from the compression process when using the /compress option.

If you name your configuration_list.ini file wimscript.ini and store it in your ImageX directory (where the ImageX.exe file is located), it will automatically run when using the /capture option (with or without the /compress option) without requiring you to use the /config option.

The /config option enables you to customize specific compression, capture, and boundary alignment actions, for each individual file and folder, within ImageX. You can create configuration_list.ini by using a text editor, such as Notepad.

Creating a Configuration List

The following sections appear in the ImageX configuration list.

Section Description

[ExclusionList]

Enables you to define the files and folders to exclude when using the /capture option.

[ExclusionException]

Enables you to override the default exclusion list when using the /capture option.

[CompressionExclusionList]

Enables you to define the specific files and folders, in addition to specific file types, to exclude when using the /compress option.

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 wildcards (*). For example, you can use C:\WINDOWS\inf\*.pnf to match a specific type of file or C:\WINDOWS\inf\* to match an entire folder.

Default Exclusion List

By default, the ImageX tool will exclude the following files.

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

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

Exclusion List Guidelines

  • You can only use wildcards in the last component in a file path that does not begin with a preceding 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, if you capture the "c:\" drive with the previous exclusion list,

    \myfolder
    \folder\subfolder
    

    The ImageX tool will exclude the following files and directories.

    c:\myfolder
    c:\folder\subfolder
    

    However, ImageX will not exclude files or directories 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 will always take precedence over the [Exclusion List] section.

  • You cannot 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 of the ImageX directory, you can use the ImageX command to run the file. At a command prompt, open the ImageX directory. For example,

imagex /config c:\imaging\<configuration_list>.ini /capture d: d:\imaging\data.wim "Drive D"

or

imagex /config c:\imaging\<configuration_list>.ini /append d: d:\imaging\data.wim "Drive D"

where c:\imaging\<configuration_list>.ini provides the complete directory location for the configuration file. You must use either the /capture option to create a new .wim file or the /append option to append an existing .wim file.

See Also

Concepts

ImageX Command-Line Options