How to run a program during RDP login on Windows Server 2025

Louis 0 Reputation points
2025-09-09T18:52:07.8966667+00:00
Good morning,

After upgrading from Windows Server 2012 to 2025, I'm no longer able to configure the RDP session to launch a specific program during connection, instead of viewing the remote desktop. 

In 2012, the setup was very easy; I just entered the path to the software to run in the "Environment" tab within the individual user's properties.

On Win2025, however, although the same option is still available, if I enter the path to the executable to run when I log in, absolutely nothing happens. The remote desktop starts normally ignoring the request to launch a specific application.

I tried modifying the group policy "User Configuration - Administrative Templates - Windows Components - Remote Desktop Services - Session Host - Remote Session Environment - "START A PROGRAM ON CONNECTION" and that way I was able to get the program to run at login as I want. However, it has the major limitation of seeing the policy applied to any RDP login and not just to certain users as i need. Furthermore, different users would have to run different software, so this group policy approach would not be viable.

I also tried editing the RDP connection settings on the client by modifying the string "alternate shell:s:C:\Program Files (x86)\"program"\"program.exe"" but I get the error "The system cannot find the file specified" during login. Obviously, the file path is CORRECT because if I copy and paste it into Win+R, it launches without any problems. So I assume there's some security block during startup.

Do you have any suggestions on other solutions to try? 
I need the operator to only be able to use his management software when he connects to the server and for the remote session to end automatically as soon as he closes the application.

Thank you
Windows for business | Windows Server | Directory services | User logon and profiles
0 comments No comments

2 answers

Sort by: Most helpful
  1. luigi grandi 0 Reputation points
    2026-05-05T02:03:16.9666667+00:00

    Hello Louis, I hope this helps : https://idatech.com.br/iniciar-programa-na-conexao-remota/

    I tried at my server and after adding the registry fQueryUserConfigFromDC DWORD with value 1 in HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services and running a gpupdate /force in CMD as Administrator, the path to the software to run in the "Environment" tab startet working.

    Was this answer helpful?


  2. Harry Phan 29,430 Reputation points Independent Advisor
    2025-09-09T20:12:09.3533333+00:00

    Dear Louis,

    While the “Environment” tab method worked reliably in previous versions, Windows Server 2025 introduces changes to session behavior and application launch permissions that may affect this setup. The group policy you applied—“Start a program on connection”—is effective but applies globally, which limits its flexibility for user-specific configurations. For more granular control, we recommend using RemoteApp publishing via Remote Desktop Services, which allows you to assign specific applications per user or group and automatically close the session when the app exits.

    Additionally, the “alternate shell” setting in the RDP file may fail if the executable requires elevated permissions or if the session context lacks access during startup. Verifying that the path is accessible to the user profile and not blocked by AppLocker or other security policies may help resolve this.

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    Best regards,

    Harry Phan

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.