SetupComplete.cmd did not run after installing Windows 10 on a tablet

A.Tom 96 Reputation points
2021-11-28T07:32:18.3+00:00

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?

Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,945 questions
0 comments No comments
{count} votes

Accepted answer
  1. A.Tom 96 Reputation points
    2021-12-05T18:35:38.367+00:00

    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

    OEM license was detected but Enterprise was not detected although I was using Windows® 10 IoT Enterprise 2021 LTSC

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Limitless Technology 39,651 Reputation points
    2021-11-30T09:52:21.727+00:00

    Hello AssafTomaschoff,

    It seems that you have the script in the right place. My only concern is that if that script was copied from a different computer, it may have some default permissions that are not aligned. If that was the case would try to:

    Rename your SetupComplete.cmd to .OLD
    Create a new SetupComplete.cmd file directly in the folder, and copy the content of your script.

    Otherwise you can try to apply the same script on ErrorHandler.cmd script in the same folder.

    All in all, it would help what are you trying to run in the script, and as well if you see anything on the C:\Windows\Panther\UnattendGC\Setupact.log referring to the load.

    More details: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-a-custom-script-to-windows-setup?view=windows-11

    ------------------------------------------------------------------------------------------------------------------------------------------------

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

    0 comments No comments

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.