Applies To: Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista

LogonCommands specifies one or more commands to run the first time a user logs on to the computer.


This setting cannot be used to launch applications that require administrative privileges to run.

To run services or commands that can start at the same time, use asynchronous commands. To run commands that need to finish before other commands can start, use FirstLogonCommands commands instead.

Child Elements


Specifies a single command to run the first time a user logs on to the computer.

Valid Configuration Passes


Parent Hierarchy

Microsoft-Windows-Shell-Setup | LogonCommands

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 logon commands.

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

See Also