we currently use this code below to get the Computer Name, this is used by our system to identify where output is sent dependant on the pc id.
however we have a number of thin client users that are using terminal server, in this case we are getting the computer name of the server, we need to be able to get the name of the allocated device, how could this be done ?
Does anyone know how this might be achieved?
* get terminal number
Use Builtin(GET_REGISTRY_VALUE) With_Args(HKEY_LOCAL_MACHINE SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName ComputerName) To_Get(#toterm #IO£STS)
computer name (RESOLVED)
Re: computer name
You'd probably get a quicker response on a terminal server forum. I found this for VMWare, maybe there is something like this for TS
https://blogs.vmware.com/euc/2009/05/vm ... ables.html
https://blogs.vmware.com/euc/2009/05/vm ... ables.html
Art Tostaine
-
paulcarpenter
- Posts: 3
- Joined: Fri May 24, 2019 11:14 pm
Re: computer name
I have found a solution to getting the correct computer name, for normal computers and thin client as follows
i have attached a system variable to this function which gets the correct results
Function Options(*DIRECT *ALP_SYSTEM_VARIABLE *NOMESSAGES)
Define_Com Class(#XPRIM_OSUtil) Name(#OSUtil)
Define_Com Class(#PRIM_BOLN) Name(#Found)
#SYSVAR£AV := #OSUtil.GetEnvironmentVariable( 'CLIENTNAME' #Found )
If Cond(#found = false)
#SYSVAR£AV := #OSUtil.GetEnvironmentVariable( 'COMPUTERNAME' #Found )
Endif
Return
i have attached a system variable to this function which gets the correct results
Function Options(*DIRECT *ALP_SYSTEM_VARIABLE *NOMESSAGES)
Define_Com Class(#XPRIM_OSUtil) Name(#OSUtil)
Define_Com Class(#PRIM_BOLN) Name(#Found)
#SYSVAR£AV := #OSUtil.GetEnvironmentVariable( 'CLIENTNAME' #Found )
If Cond(#found = false)
#SYSVAR£AV := #OSUtil.GetEnvironmentVariable( 'COMPUTERNAME' #Found )
Endif
Return