Is library running on Citrix or Terminal Server? - Testing on existence/value of environment variable SESSIONNAME - Solution

bub buppeke at
Fri Jan 26 10:40:42 EST 2018

Hey all,

I would love to find out if my library is running on Citrix or Terminal 

Apparently, the environment variable SESSIONNAME is only defined on 
Citrix or Terminal Server so that would be a way to find it out, even 
more specific

Citrix client => SESSIONNAME starts with ICA
Rdp client => SESSIONNAME starts with rdp
Console session => SESSIONNAME starts with console

Is there any DLL that can provide the value of an envirnoment variable 

Ok, just did some more effort in scrolling through historic posts and 
found similar construction to get username (which i changed now to 

Register DLL ('kernel32','GetEnvironmentVariableA','ICCM')
Call DLL ('kernel32','GetEnvironmentVariableA','SESSIONNAME',%%SESSIONNAME,255)

So solution found, happy to share, might me be interesting for some


This email has been checked for viruses by Avast antivirus software.

More information about the omnisdev-en mailing list