Share via


Specify a Program to Start Automatically When a User Logs On

Applies To: Windows Server 2008 R2

By default, Remote Desktop Services sessions provide access to the full Windows desktop, unless a program has been specified to start when the user logs on to the remote session.

If an initial starting program has been specified, it will be the only program that the user can use in the Remote Desktop Services session. The Start menu and the Windows Desktop are not displayed when the user logs on to the remote session, and when the user exits the program the session is automatically logged off.

Note

Specifying an initial program to run does not apply to a RemoteApp session. For more information about RemoteApp, see the topic "Overview of RemoteApp" in the RemoteApp Manager Help in Windows Server 2008 R2.

Configuring the initial starting program on a per connection basis affects all users that use the connection.

You can configure the initial starting program on a per user basis by using the Remote Desktop Services Extension to the Local Users and Groups snap-in or to the Active Directory Users and Computers snap-in.

Initial starting program settings configured by using Remote Desktop Session Host Configuration will take precedence over initial starting program settings that have been configured for a specific user account or that the user has specified in Remote Desktop Connection.

Use the following procedure to specify a program to start when the user logs on to a remote session.

Membership in the local Administrators group, or equivalent, on the RD Session Host server that you plan to configure, is the minimum required to complete this procedure. Review details about using the appropriate accounts and group memberships at https://go.microsoft.com/fwlink/?LinkId=83477.

To specify a program to start when the user logs on to a remote session

  1. On the RD Session Host server, open Remote Desktop Session Host Configuration. To open Remote Desktop Session Host Configuration, click Start, point to Administrative Tools, point to Remote Desktop Services, and then click Remote Desktop Session Host Configuration.

  2. Under Connections, right-click the name of the connection, and then click Properties.

  3. In the Properties dialog box for the connection, on the Environment tab, configure the initial starting program settings as appropriate for your environment.

    If you select Start the following program when the user logs on, do the following:

    1. In the Program path and file name box, enter the fully qualified path and file name of the executable file to be run when the user logs on.

    2. If necessary, in the Start in box, enter the fully qualified path to the starting directory for the program.

Note

If you leave the Start in box blank, the program runs with its default working directory. If the specified program path, file name, or working directory is not the name of a valid directory, the RD Session Host server connection fails with an error message.

  1. Click OK. Changes made on the Environment tab are not applied to sessions that are connected when the change is made. The changes will take effect the next time the user establishes a new connection to the RD Session Host server.

You can also configure whether a program or the desktop appears when the user logs on to a remote session by applying the following Group Policy settings:

  • Start a program on connection

  • Always show desktop on connection

These Group Policy settings are located in the following locations:

  • Computer Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Remote Session Environment

  • User Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Remote Session Environment

These Group Policy settings can be configured by using either the Local Group Policy Editor or the Group Policy Management Console (GPMC).

Note

These Group Policy settings will take precedence over the settings configured in Remote Desktop Session Host Configuration. If both the Computer Configuration and the User Configuration policy settings are configured, the Computer Configuration policy settings take precedence. Also, the Always show desktop on connection policy setting will take precedence over the Start a program on connection policy setting.

For more information about Group Policy settings for Remote Desktop Services, see the Remote Desktop Services Technical Reference (https://go.microsoft.com/fwlink/?LinkId=138134).

For information about starting a program on a per user basis, see the topic "<UserAccount> Properties: Environment Tab " in the Remote Desktop Services User Properties Help in Windows Server 2008 R2.

Additional references