Remote App and Environmental Variables

remote-desktop-serviceswindows-server-2012-r2

So the basics, running a Windows 2012 R2, RDS (Terminal Server), with a published Remote App. Trying to connect with clients running the Win 10 anniversary update, all computers are properly joined to the domain, etc…

Everything works fine, except the specific Remote App requires an environmental user variable to work properly.

If the client PC, uses a full remote desktop connection and runs the app from inside the rdp session, it works perfectly. However, I would like to run the Remote App on the client machine, with an .rdp file, opening just the remote app on the client desktop.

This also works fine, except for some reason the environmental variable is not used, and the app returns an error asking me to establish an env variable.

I have both the local PC and the RDS server set with the same env variable for that particular domain user, but it still gives me the error.

How can I tell the .rdp file to use a user defined environmental variable?

I'm very new to this, and spent a good 5-6 hours trying to troubleshoot the other day and have thrown my hands up in

Best Answer

So, not that is is really an answer, but a coding friend of mine just made a new Application for me, that basically, sets the environmental variable in the current session, then launches the RemoteApp that was originally intended to be launched, this seems to remove any issues with passing environmental variables. Unfortunately it requires allowing any cmd param to be passed to the remoteapp (luckily it's only his small app that is about 5 lines long).