Issue applying image with imagex

Koepe 21 Reputation points
2021-11-04T11:14:22.417+00:00

Hi,

I used to create Windows 10 ISOs for automated installation from a boot-stick.
Therefore I installed Windows on a VM, installed Updates, SW and so on. I did a sysprep, captured the wim file with dism.
This wim file wass splitted into swm files.
Next step was creating the ISO with a customized copype file in Windows Kits Preinstallation Environment.
When I want to install a new VM or physical PC with this ISO I get an error.
"Error setting wim reference file.
Error restoring image.
Cannot created a file when that file already exists."

The process when booting from stick is the following:
diskpart automatically creates gpt partitions
next step is a script called install.cmd

It´s written like this:

diskpart /s x:\tools\diskpart.txt

if exist d:\sources\install.swm goto lectd
if exist e:\sources\install2.swm goto lecte
if exist f:\sources\install3.swm goto lectf
if exist g:\sources\install4.swm goto lectg

:lectd
imagex /apply d:\sources\install.swm /ref d:\sources\install*.swm 1 c:
c:\windows\system32\bcdboot c:\windows /s S: /f ALL

pause
shutdown -s -t 00

:lecte
imagex /apply e:\sources\install.swm /ref e:\sources\install*.swm 1 c:
c:\windows\system32\bcdboot c:\windows /s S: /f ALL

pause
shutdown -s -t 00

:lectf
imagex /apply f:\sources\install.swm /ref f:\sources\install*.swm 1 c:
c:\windows\system32\bcdboot c:\windows /s S: /f ALL

pause
shutdown -s -t 00

:lectg
imagex /apply g:\sources\install.swm /ref g:\sources\install*.swm 1 c:
c:\windows\system32\bcdboot c:\windows /s S: /f ALL

pause
shutdown -s -t 00

This worked the last time I created an image with this procedure (I guwess it was windows 10 18xx, 3 years ago).

Has anyone an idea or can help me out why the error appears?

Windows for business Windows Client for IT Pros Networking Network connectivity and file sharing
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 39,916 Reputation points
    2021-11-04T19:18:37.683+00:00

    Hello @Koepe

    It is not recommended to use imagex (taken as depreciated) due to this issues in Windows 10 newer versions.

    The "modern" way would be through DISM: You can find more details about the how-to here: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/capture-and-apply-windows-system-and-recovery-partitions?view=windows-11

    Hope this helps with your query,

    ----------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.