Table of contents
Collapse the table of content
Expand the table of content


Last Updated: 12/12/2016

CommandLine specifies the path to the SynchronousCommand to be run at first logon.

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

  • 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 are not executed.

  • If User Account Control is disabled, these commands are not executed.

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.



Specifies the path to the command to be run at first logon. Path_to_command is a string with a maximum length of 1024 characters.

This string type supports empty elements.

Valid Configuration Passes


Parent Hierarchy

Microsoft-Windows-Shell-Setup | FirstLogonCommands | SynchronousCommand | CommandLine

Applies To

For a 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.

   <SynchronousCommand wcm:action="add">
   <SynchronousCommand wcm:action="add">


Send comments about this topic to Microsoft

© 2017 Microsoft