Contact Us |Home
 

Resource Dynamics, Inc.

 

Tele-Support HelpDesk Hot Tips

Index by Tip Id | Index by Description | Search Keywords | Search Text
GOGLOBAL07 GOGLOBAL07
Get computer name

Problem:

Some program I am trying to run requires the client computer name.

Article C00020

Issue: The Windows API GetComputerName retrieves the computer name of the GO-Global Server rather than the client that is running the application.

Solution:

When there is a program that requires the client's computer name, administrators can add the name of that executable under the registry key

HKEY_LOCAL_MACHINE\SOFTWARE\GraphOn\Bridges\1.0.0\Compatibility\GetComputerName as a DWORD with a data value of 0x00000001. Any time an executable matching any of the names listed under this registry key with a data value of 0x00000001 calls GetComputerName, the given buffer will be filled in with the client's name rather than the server's.

Additionally, there is a new environment variable named CLIENTCOMPUTERNAME that exists as part of the running environment of a published application. This environment variable contains the client's computer name. The standard Windows environment variable COMPUTERNAME remains unchanged; its value is the server's computer name.  

To add an application to the list of those that get the client's computer name rather than the GO-Global Server's when calling the Windows GetComputerName API, perform the following steps:

1.       Run the Registry Editor (regedit.exe)

2.       From the Registry Editor, expand the HKEY_LOCAL_MACHINE key.

3.       Locate the GetComputerName key:

          [SOFTWARE\GraphOn\Bridges\1.0.0\Compatibility\GetComputerName]

4.       Create a DWORD entry for the executable (pw.exe).

5.       Set the value of the new entry to 0x00000001.

6.       Close the Registry Editor.


Copyright © 2004 Resource Dynamics, Inc. * Created with Tele-Support HotTips Publisher