wdsutil replace-image

适用范围:Windows Server 2022、Windows Server 2019、Windows Server 2016、Windows Server 2012 R2、Windows Server 2012

将现有映像替换为该映像的新版本。

语法

对于启动映像:

WDSUTIL [Options]
        /Replace-Image
        /Image:<Image name>
        [/Server:<Server name>]
        /ImageType:Boot
        /Architecture:{x86 | x64 | arm | arm64}
        [/Filename:<File name>]
        /ReplacementImage
          /ImageFile:<WIM file path>
          [/Name:<Image name>]
          [/Description:<Image description>]

/Architecture:{x86 | x64 | arm | arm64}
        The architecture of the image to be replaced. Since it is
        possible to have the same image name for boot images in
        different architectures, specifying the architecture value
        ensures that the correct image is replaced.

[/Filename:<File name>]
        If the image cannot be uniquely identified by name, the file
        name must be specified.

/ReplacementImage
  /ImageFile:<WIM file path>
        Specifies the full path and file name of the new WIM file.

  [/Name:<Name>]
        Sets the display name of the image.

  [/Description:<Description>]
        Sets the description of the image.

对于安装映像:

WDSUTIL [Options]
        /Replace-Image
        /Image:<Image name>
        [/Server:<Server name>]
        /ImageType:Install
        [/ImageGroup:<Image group name>]
        [/Filename:<File name>]
        /ReplacementImage
          /ImageFile:<WIM file path>
          [/SourceImage:<Source image name>]
          [/Name:<Image name>]
          [/Description:<Image description>]

[/ImageGroup:<Image group name>]
        The image group containing the image to be replaced. If not
        specified and only one image group exists on the server, that
        image group will be used by default. If more than one image
        group exists on the server, then the image group must be
        specified.

[/Filename:<File name>]
        If the image cannot be uniquely identified by name, the file
        name must be specified.

/ReplacementImage
  /ImageFile:<WIM file path>
        Specifies the full path and file name of the new WIM file.

  [/SourceImage:<image name>]
        Specifies the image to use if the new WIM file contains
        multiple images.

  [/Name:<Name>]
        Sets the display name of the image.

  [/Description:<Description>]
        Sets the description of the image.

参数

参数 说明
/Image:<Image name> 指定要替换的映像名称。
[/Server:<Server name>] 指定服务器的名称。 可以是 NetBIOS 名称或完全限定域名 (FQDN)。 如果未指定服务器名称,将使用本地服务器。
mediatype:{Boot | Install} 指定要替换的映像类型。
/Architecture:{x86 | ia64 | x64} 指定要替换的映像的体系结构。 由于不同体系结构中的不同启动映像可能具有相同的映像名称,因此指定体系结构值可确保替换正确的映像。
[/Filename:<File name>] 如果无法按名称唯一标识映像,则必须使用此选项指定文件名。
/replacementImage 指定替换映像的设置。 可以使用以下选项设置这些设置:

- mediaFile:<file path> - 指定新 .wim 文件的名称和位置(完整路径)。
- [/SourceImage: <image name>] - 指定在 .wim 文件包含多个映像时要使用的映像。 此选项仅适用于安装映像。
- [/Name:<Image name>] 设置要映像的显示名称。
- [/Description:<Image description>] - 设置映像的说明。

示例

若要替换启动映像,请键入以下内容之一:

WDSUTIL /Replace-Image /Image:"WinPE Boot Image" /ImageType:Boot /Architecture:x86 /ReplacementImage /ImageFile:"C:\MyFolder\Boot.wim"

WDSUTIL /Verbose /Progress /Replace-Image /Image:"WinPE Boot Image" /Server:MyWDSServer /ImageType:Boot /Architecture:x64 /Filename:boot.wim /ReplacementImage /ImageFile:\\MyServer\Share\Boot.wim /Name:"My WinPE Image" /Description:"WinPE Image with drivers"

若要替换安装映像,请键入以下内容之一:

WDSUTIL /Replace-Image /Image:"Windows 10 Home"
/ImageType:Install /ReplacementImage /ImageFile:"C:\MyFolder\Install.wim"

WDSUTIL /Verbose /Progress /Replace-Image /Image:"Windows 10 Pro" /Server:MyWDSServer /ImageType:Install /ImageGroup:ImageGroup1 /Filename:Install.wim /ReplacementImage /ImageFile:\\MyServer\Share \Install.wim /SourceImage:"Windows 10 Pro" /Name:"Windows Vista Desktop" /Description:"Windows 10 Pro with standard business applications."