SetupComplete not running

carlosmp

New Member
Messages
18
Reaction score
1
[windeploy.exe] Client non-Enterprise OS edition detected with OEM license; will not run user-provided scripts.
[windeploy.exe] Not allowed to run the Setupcomplete.cmd, will not run SetupComplete.cmd

I'm using Windows 11 24H2 Pro, so seems my best option is to try and use the RunSynchronousCommand, but not sure how to implement that. Any other ideas on how best to do this? I'm essentially looking for a way to run setupcomplete.cmd before login. I have a ps script that is called by it, and it's fully automated.

ChatGPT seems to insist that there's an "expert" menu in NTLite, and a way to add settings, but my Pro version (2025.4) does not show anything...

I've also attempted to add to the xml file (without the settings pass header):
Code:
<settings pass="specialize">
  <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
    <RunSynchronous>
      <RunSynchronousCommand wcm:action="add">
        <Order>1</Order>
        <Description>Invoke SetupComplete.cmd</Description>
        <Path>cmd /c "%WINDIR%\Setup\Scripts\SetupComplete.cmd"</Path>
      </RunSynchronousCommand>
    </RunSynchronous>
  </component>
</settings>

But then NTLite seems to think it's invalid and won't let me load it.

TIA
 
windeploy.exe skips running SetupComplete.cmd, when it finds an OEM product key in the BIOS. This is by design.

The normal workarounds are:
1. Move your SetupComplete tasks to Post-Setup (Before logon), and allow NTLite to create and schedule SetupComplete.cmd for you. This script will execute on all systems, regardless of license status.

2. Run SetupComplete from the specialize pass, but technically this executes before OOBE. If you're only running system-level tasks, and don't depend on have any users being provisioned, it's really not a problem.


NTLite already supports option 2 (so you don't have to edit autounattend.xml), but there's no need to use it since the Default mode works for all PC's. The second option is provided as a legacy feature for backwards compatibility with older NTLite presets.

Default - Works on all PC's, SetupComplete runs after OOBE
Unattended - Works on all PC's, runs in specialize pass
Windows default - Doesn't work on PC's with OEM licenses, runs after OOBE

Capture.PNG
 
windeploy.exe skips running SetupComplete.cmd, when it finds an OEM product key in the BIOS. This is by design.
Isn't that also true when you're using an OEM product key during setup but don't have an OEM key in the BIOS?
 
I am having an issue with my WDS image where commands break the installer and I get the attached error. Based on what you are saying here in this thread it sounds like my issue is how these post-install routines are running. My assumption is that I am doing something thats breaking the syntax?

I get this with PS scripts, and PS commands. I did not get it with a .bat - but it also didn't run.
My goal is to run a post-process script that installs a few things and makes some additional changes that can't be made before the first login. In an ideal world I would love for it to pull the script from the network so I don't have to recompile every. Time. I. Make. A. Change. and can just change the script as needed.

I will say that when running the install from an ISO on a USB the script runs much more reliabily, but there are also certain scenarios where it too fails with the attached error.
 

Attachments

  • Error.jpg
    Error.jpg
    54.9 KB
The default Execution Policy for PS is not to trust scripts.

NTLite will create a SetupComplete.cmd that calls every PS script, with "powershell -NoProfile -ExecutionPolicy Bypass" to get around having to permanently change the current execution policy. You might want to check that first.
 
Back
Top