Page 1 of 1

REMOTE DESKTOP

Posted: Fri Jun 05, 2015 2:06 pm
by Jack
When i execute an application with Remote Desktop (TS) ,
the function GetEnv( "COMPUTERNAME" ) return the NAME of the SERVER and not the name of the workstation that execute Remote Desktop .

How to know this name ?

Thanks

Re: REMOTE DESKTOP

Posted: Fri Jun 05, 2015 2:25 pm
by Gale FORd
When on Remote Desktop/Terminal Services/Citrix you can use additional environment variables.
gete( 'SESSIONNAME' ) // This returns the session name you are running under. If it returns anything other than 'Console' then you need to get the clientname
gete( 'CLIENTNAME' ) // This is the local computer name or client.

Try this

Code: Select all

cComputer := gete('CLIENTNAME')
if empty( cComputer )
   cComputer := gete('COMPUTERNAME')
endif

 

Re: REMOTE DESKTOP

Posted: Sat Jun 06, 2015 8:27 am
by Jack
Thanks for your help .

It works .

Thanks