Reasons for FirstLogonCommands to not execute? RRS feed

  • 問題

  • I'm building and deploying a Windows 10 Pro image with WDS & MDT and every tweak and task is pretty much done except for some stuff that needs to be done through FirstLogonCommands. The problem is that my FirstLogonCommand doesn't seem to execute and I can't figure out why.

    - No errors are present in setuperr.log and setupact.log has a mention of executing the FirstLogonCommand:
    2019-07-22 11:08:31, Info [Shell Unattend] LogonCommands: Set command 'C:\windows\setup\scripts\FirstLogon.cmd'
    - Autologin is enabled in Unattend.xml with an Administrator account and the autologin works.
    - The unattended install is done with an Administrator account.
    - My FirstLogonCommands script is copied to C:\Windows\Setup\Scripts\FirstLogon.cmd , so the file is present on the machine that receives the image.
    - If I execute the FirstLogon.cmd command manually on the machine that received the image, it runs without any problems.
    - The image is based on Windows 10 PRO 1803 from VLSC.

    What could be reasons for the FirstLogonCommand not executing?

    Below is a part of my Unattend.xml:
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="SECRET" language="neutral" versionScope="nonSxS" xmlns:wcm="">
            <SynchronousCommand wcm:action="add">
              <CommandLine>wscript.exe %SystemDrive%\LTIBootstrap.vbs</CommandLine>
              <Description>Lite Touch new OS</Description>
            <SynchronousCommand wcm:action="add">
          <RegisteredOwner>Company Admin</RegisteredOwner>
        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="SECRET" language="neutral" versionScope="nonSxS" xmlns:wcm="" xmlns:xsi="">

    Thanks in advance

    • 已編輯 zzmm200 2019年7月22日 上午 10:51
    2019年7月22日 上午 10:05


  • I am not sure but when I use FirstLogonCommands the order is tag is before the command.

    For Example:

            <SynchronousCommand wcm:action="add">
              <CommandLine>wscript.exe %SystemDrive%\LTIBootstrap.vbs</CommandLine>
            <SynchronousCommand wcm:action="add">

    You could test it.

    2019年7月22日 上午 11:50
  • Thanks for your reply. Unfortunately same result. Any other ideas?

    Does it matter for the FirstLogonCommands if my Win isn't activated yet when it is deployed?

    • 已編輯 zzmm200 2019年7月22日 下午 03:18
    2019年7月22日 下午 02:43
  • This is a batch file so you will want to run cmd.exe to execute it as follows:

    cmd.exe /c c:\windows\setup\scripts\FirstLogon.cmd

    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - /

    2019年7月22日 下午 06:11
  • Ordering of elements does not matter. They are not executing in order, instead the entire file is sent into the parser and it will (essentially) perform a transform to make use of the data.
    2019年7月22日 下午 07:26
  • Same result unfortunately. Doesn't seem to run.
    2019年7月26日 上午 10:42
  • It should run when the first local user account logs into the system. Are you logging in with a local account, domain account or Microsoft account? This difference might matter.
    2019年7月26日 下午 06:40
  • Can you run it manually after OS installation? 

    Typically, the Pass7 commands run when you log into an Administrator account for the first time. If the system boots into a User account you will have to log out and log into an Administrator account for the commands to run.

    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - /

    2019年7月27日 下午 05:37