SetupComplete.cmd is not running

1.8k Views Asked by At

I'm using an unattended installation of Windows 10 21H2 LTSC using an "answer file" (unattend.xml) on a surface pro 7 plus device.

I have placed SetupComplete.cmd at: %windir%\setup\scripts as suggested from the documentation in the image file (WIM file). I can see the file is in place after Windows installation is done.

Following the installation on the tablet I see that the commands in SetupComplete.cmd were not executed. There is nothing in the log file where SetupComplete.cmd should write to.

Is there something else to do so this file (SetupComplete.cmd) will run? Registry? answer-file?

Any suggestions?

1

There are 1 best solutions below

1
Atom On

As it seems my issue is related to the following KB:

https://learn.microsoft.com/en-us/troubleshoot/mem/configmgr/os-deployment-task-sequence-not-continue

In my case I was using Windows® 10 IoT Enterprise 2021 LTSC but Setup could not detect that it was an Enterprise edition so did not run the script:

[windeploy.exe] Client OS detected: 1

[windeploy.exe] OEM Licensing detected: 1

[windeploy.exe] **EnterpriseS or Enterprise or EnterpriseSN or EnterpriseN edition detected: 0**

[windeploy.exe] Client OS edition and OEM license detected and no enterprise edition detected, will not run SetupComplete.cmd

This explains why Setup did has decided not to run SetupComplete.cmd - a poor decision since it was an "Enterprise" edition after all. This seems like a bug in Windows Setup. Still waiting for a resolution from MSFT.