SynchronousCommand

SynchronousCommand specifies a single command to run the first time a user logs on to the computer. FirstLogonCommands are run after logon but before the user sees the desktop.

If you create a user account that does not include administrative privileges, the following commands may not run:

  • If User Account Control is enabled, then when that user logs in for the first time, a dialog box appears, prompting the user with an option to allow an administrator to apply the commands. If the user selects Cancel, these commands don’t run.
  • If User Account Control is disabled, these commands don’t run.

When you add a script using FirstLogonCommands, it will be triggered on the next boot, even if you boot into audit mode using Ctrl+Shift+F3. If you plan to use audit mode later, add the following setting to skip this script automatically: Microsoft-Windows-Deployment\Reseal\Mode = Audit.

Note

These commands now run asynchronously with respect to the other work happening when a user logs on to the computer. However, each command is still run sequentially in the specified order. That is, unlike Microsoft-Windows-Shell-Setup-LogonCommands-AsynchronousCommand all commands using these unattend settings are not started at the same time, and still wait for the previous command to finish.

Child Elements

Setting Description
CommandLine Specifies the path to the command to run.
Description Describes the command to run.
Order Specifies the order in which the command is run.
RequiresUserInput Specifies whether the first logon command launches a dialog box that requires input from the user. This can reduce the delay of the "Preparing Your Desktop" screen.

Note

FirstLogonCommands are not supported in Windows 10 in S mode.

Valid Configuration Passes

oobeSystem

Parent Hierarchy

Microsoft-Windows-Shell-Setup | FirstLogonCommands | SynchronousCommand

Applies To

For the list of the supported Windows editions and architectures that this component supports, see Microsoft-Windows-Shell-Setup.

XML Example

The following XML output shows how to set first logon commands.

<FirstLogonCommands>
   <SynchronousCommand wcm:action="add">
      <CommandLine>c:\synccommands\command1.exe</CommandLine>
      <Description>Description_of_command1</Description>
      <Order>1</Order>
   </SynchronousCommand>
   <SynchronousCommand wcm:action="add">
      <CommandLine>c:\synccommands\command2.exe</CommandLine>
      <Description>Description_of_command2</Description>
      <Order>2</Order>
   </SynchronousCommand>
</FirstLogonCommands>

FirstLogonCommands