Microsoft KB Archive/321707

= HOW TO: Automatically Run Programs When Users Log On to Windows 2000 Terminal Services =

Article ID: 321707

Article Last Modified on 9/14/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition

-



This article was previously published under Q321707



IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

IN THIS TASK
SUMMARY By Using Client Connection Manager
 * Specify the Program to Start When You Create a New Connection
 * To Change the Program to Start

By Using the Environment Tab By Using a Program Shortcut in the Startup Folder By Using Group Policy By Using the Registry By Using a Logon Script
 * To Assign a User Logon Script to a User



SUMMARY
This article describes how to use various methods to have programs start automatically when users log on to Terminal Services.

back to the top

By Using Client Connection Manager
You can specify a program to start either when you create a new connection in Client Connection Manager, or after you create a connection.

back to the top

Specify the Program to Start When You Create a New Connection
To create a new connection to the Terminal Services server:
 * 1) On the client computer, click Start, point to Programs, point to Terminal Services Client, and then click Client Connection Manager.
 * 2) In the Client Connection Manager Wizard, click Next.
 * 3) In the Connection name box, type a descriptive name for the connection.
 * 4) In the Server name or IP address box, type the server's name or IP address, or click Browse to search for the server. When you finish, click Next.
 * 5) Leave all of the automatic logon information blank. Using automatic logon information might be a security is if a non-administrator has access to the computer from which you run the client. Click Next.
 * 6) Click a screen resolution that is appropriate for you.
 * 7) Leave the Enable data compression and Cache bitmaps check boxes clear unless you are working over a slow dial-up link. Click Next.
 * 8) Click to select the Start the following program check box, and then type the path and file name of the program that you want to start when a connection is made. In the Start in box, type the working folder, if required.
 * 9) Click Next, and then click Finish.

back to the top

To Change the Program to Start

 * 1) On the client computer, click Start, point to Programs, point to Terminal Services Client, and then click Client Connection Manager.
 * 2) Click the connection to change.
 * 3) On the File menu, click Properties.
 * 4) On the Program tab, click Start the following program, and then type the path and file name of the program that you want to start when a connection is made. In the Start in box, type the working folder, if required.

back to the top

By Using the Environment Tab
To specify a program to start when a session connection is made by using the Environment tab:
 * 1) Use the appropriate step:
 * 2) * For a domain user account, start Active Directory Users and Computers. In the console tree, expand the Domain node, and then click the folder in which users are located.
 * 3) * For a local user account, start Computer Management (Local). In the console tree, click Users. (Expand Computer Management, expand System Tools, expand Local Users and Groups, and then click Users.)
 * 4) Double-click the user for whom you want to change the program that starts.
 * 5) On the Environment tab, under Starting program, click to select the Start the following program at logon check box.
 * 6) In the Program file name box, type the path and file name of the program to start when the user logs on. You can also specify a working folder by typing the path in the Start in box.
 * 7) Click Apply.

Notes:
 * To start Active Directory Users and Computers, click Start, point to Programs, point to Administrative Tools, and then click Active Directory Users and Computers.
 * To start Computer Management, click Start, point to Settings, click Control Panel, double-click Administrative Tools, and then double-click Computer Management.

back to the top

By Using a Program Shortcut in the Startup Folder
 On the Terminal Services server, start Windows Explorer, and then open the user's Startup folder. By default, this folder is:

C:\Documents and Settings\ \Start Menu\Programs\Startup

 On the File menu, point to New, and then click Shortcut. In the Type the location of the item box, type the path and file name of the program to start. Click Next. Click the Startup folder, and then click Next. Type a name for the shortcut or accept the default. Click Finish, and then click OK.</li></ol>

back to the top

By Using Group Policy
You can specify programs or documents that are started automatically when a user logs on by using the &quot;Run these programs at user logon&quot; policy. NOTE: This policy appears in the Computer Configuration and User Configuration folders. If you configure both policies, Windows starts the programs that you specify in the Computer Configuration policy before it starts the programs that you specify in the User Configuration policy.
 * 1) On the Terminal Services server, start Microsoft Management Console (MMC), and then add the Group Policy snap-in.
 * 2) Click Local Computer Policy, click Computer Configuration, and then click Administrative Templates.
 * 3) Click the System object, double-click Run these programs at user logon in the list of Local System policies in the right pane, and then click Enable.
 * 4) Click Show, and then click Add.
 * 5) Type the name of the program (.exe) file or document file. Unless the file is located in the %SystemRoot% folder, you must specify the fully qualified path to the file.
 * 6) Click OK.

back to the top

By Using the Registry
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

You can specify a command line in the registry to start a program when users log on to Terminal Services: <ol> On the Terminal Services server, start Registry Editor (Regedt32.exe).</li> Locate and then click the following key in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

</li> On the Edit menu, point to New, and then click String Value.</li> Type any name for the value, and then click Modify on the Edit menu.</li> In the Value Data box, type the command line for the program that you want to start when users log on.</li> Click OK, and then quit Registry Editor.</li></ol>

back to the top

By Using a Logon Script
You can create a logon script that runs specific programs when users log on. You can assign that script to a user. For more information about creating logon scripts to configure user work environments, visit the following Microsoft Web site:

Using logon scripts to configure user work environments

back to the top

To Assign a User Logon Script to a User

 * 1) Start Computer Management.
 * 2) In the console tree, click Users (under System Tools and then Local Users and Groups).
 * 3) Double-click the user to whom you want to assign a logon script.
 * 4) Click the Profile tab.
 * 5) In the Logon script box, type the path and name of the logon script that you want to assign to the user, and then click OK.

Notes:
 * To start Computer Management, click Start, click Programs, click Administrative Tools, and then click Computer Management.
 * The path to the logon script is relative to the local logon script path on the server.

For additional information about assigning scripts to users, click the article number below to view the article in the Microsoft Knowledge Base:

258286 How to Assign a Logon Script to a Profile for a Local User

back to the top

Keywords: kbhowto kbhowtomaster KB321707

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.