computer name (RESOLVED)

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
paulcarpenter
Posts: 3
Joined: Fri May 24, 2019 11:14 pm

computer name (RESOLVED)

Post by paulcarpenter » Mon Oct 07, 2019 9:04 pm

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)

atostaine
Posts: 411
Joined: Wed Jan 20, 2016 7:38 am

Re: computer name

Post by atostaine » Tue Oct 08, 2019 2:03 am

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
Art Tostaine

paulcarpenter
Posts: 3
Joined: Fri May 24, 2019 11:14 pm

Re: computer name

Post by paulcarpenter » Tue Oct 08, 2019 2:45 am

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

Post Reply