FirstLogonCommands specifies commands to run the
first time a user logs on to the computer. These commands run only
When a user with administrative privileges logs in for the first time, these commands are run with elevated access privileges.
|In Windows® 8 oobe.cmd and Setupcomplete.cmd are disabled if an OEM product key is used. This is to ensure that end users reach Start as quickly as possible. Any tools or services that use this infrastructure need to be moved to post Out-Of-Box Experience (OOBE) tasks.|
|If you create a user account that does not include
administrative privileges, the commands may not be executed:
The commands run after logon, prior to showing the desktop.
The commands run in the order specified. Each command must finish before the next command runs.
If the command launches a separate system process, the system process will run independently of the commands. This enables you to create commands that terminate quickly, allowing the user to reach the desktop faster.
Other processes, such as services, are not restricted by
FirstLogonCommands and will continue to start or to
To start a command that needs to finish before other commands
can start, use
FirstLogonCommands. To run services or
commands that can start at the same time, use LogonCommands
Specifies a command to run the first time a user logs on to the computer, its description, and the order in which it is run.
Valid Configuration Passes
Microsoft-Windows-Shell-Setup | FirstLogonCommands
For a list of the supported Windows® editions and architectures that this component supports, see Microsoft-Windows-Shell-Setup.
The following XML output shows how to specify two commands to run after first logon.
<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>