# Remote Desktop: What is the difference between “Run these programs at logon” and “Start the following program on connection”?

My organization is running a Terminal Server Farm in order to provide a specific application to the users. The setup consists of a AD domain controller plus two Terminal Servers running the Remote Desktop Services. All servers are running Windows Server 2008 R2 Standard.

The users are outside our organization, thus the client configuration is outside our scope. We will only provide them with a RDP connection file and a username which is stored in the AD. In the RDP file, we configured "Start the following program on connection" = C:\path\to\batchscript.bat. When a user connects, the batch script does some cleanup and configuration stuff and then launches the actual application. The user does his work and closes the application afterwards. When the application is closed, the user is being logged out, and the RDP session is ended.

This setup worked fine until the first user upgraded to Windows 10. Apparently, in Windows 10 the option "Start the following program on connection" was removed from mstsc.exe, leaving the user back with the Terminal Server's desktop instead of launching our batch script.

To prevent this, I set up the following GPO: User Configuration \ Admin Templates \ System \ Logon \ Run these programs at logon = C:\path\to\batchscript.bat. As far as I understood, this should override the client's "Start the following program on connection" setting. In fact, the batch script runs and launches the application. Everything behaves as expected, except that the user won't be logged out when the application is closed, leaving him with a completely empty desktop screen.

Apparently, the GPO "Run these programs at logon" does not correspond to the mstsc.exe setting "Start the following program on connection".

What's the difference between these two? Is there another GPO which does exactly the same as the mstsc.exe setting?