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

  • As an fyi, all this application needs is a variable [User#] with a value (1,2,3.. etc). This is a 3rd party app, so I can't change anything in it. I've tried adding command line arguments on the rdp file, such as "set user#=8" or "setx user# 8" but it says I need to specify more parameters – TheMrMystery Sep 28 '16 at 14:43
  • I have both the local PC and the RDS server set with the same env variable for that particular domain user - A Remote App isn't technically running on the client machine. It runs on the server just like it does in an RDS desktop session. The difference being that with a Remote App only the app is presented to the user. Setting your environment variable on the client should be irrelevant to the problem. I'm fairly certain that you need to set a command-line argument for your environment variable in the properties of the Remote App. – joeqwerty Sep 28 '16 at 14:48
  • Yea, my thoughts too, but everything I've tried does not work (i.e., entering in a set variable=value, or a setx variable value), I've even tried creating a .bat file, with a setx command in it, and having the Remote App run the .bat file. – TheMrMystery Sep 28 '16 at 15:07

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.