1

I'm trying to use the environment variable SESSIONNAME to detect if we are executing inside a TerminalServer session. The method Environment.GetEnvironmentVariable("SESSIONNAME"); is returning RDP-Tcp#0 but when I check the environment variables with SET I cannot see that environment variable.

See the following screenshot:

enter image description here

Somebody has an idea of what's going on? Or maybe I should try to detect the TerminalService hosting in another way?

Thanks in advance.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207
  • This might help in terms of detection. http://stackoverflow.com/questions/4186153/api-for-determining-if-app-is-running-on-citrix-or-terminal-services As for your discrepancy, is Visual studio installed on the terminal server as well? – Tony Hopkinson Aug 24 '12 at 14:12
  • @TonyHopkinson yes, it is. Thanks for the link. – Ignacio Soler Garcia Aug 24 '12 at 15:32

0 Answers0