How to access registry on the server from desktop


My delphi application will be installed on a server. An enduser will use a shortcut on their desktop to run the executable on the server.
My application will o.a. check if SQL Server is installed in the registry, but when I check the registry, it will always check the registry on the desktop in stead of on the server.

Is there a way to make sure the application will check the registry on the server?
Stef MerlijnDeveloperAsked:
Who is Participating?
Geert GConnect With a Mentor Oracle dbaCommented:
you can access a registry  on another from Delphi like this:
off course, this only works if the user has priviliges for this

uses Registry;

Reg := TRegistry.Create;
  if Reg.RegistryConnect(COMPUTERNAME) then
      aKey := 'Software\Microsoft';
      if Reg.OpenKey(aKey, False) then

An enduser will use a shortcut on their desktop to run the executable on the server
The executable is not run on the server if started on the clients desktop,
but on this client itself !
* TRY to open a SQL Server connection and trap any failure.  (simplest)
* What data does the server registry contain that you couldn't place in the application directory?
* Maybe you could look for other things on the client that would indicate an ability to connect to the server, such as ODBC definitions.
* use WMI to access registry entries.
Stef MerlijnDeveloperAuthor Commented:
Clean and simple. Thank you very much!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.