How to access registry on the server from desktop

Hi,

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;
try
  Reg.RootKey := HKEY_LOCAL_MACHINE;
  if Reg.RegistryConnect(COMPUTERNAME) then
  begin
      aKey := 'Software\Microsoft';
      if Reg.OpenKey(aKey, False) then
        //


IMO
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 !
0
 
aikimarkCommented:
* 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.
http://msdn.microsoft.com/en-us/library/aa394600(VS.85).aspx
http://www.online-admin.com/wmiset.html
0
 
Stef MerlijnDeveloperAuthor Commented:
Clean and simple. Thank you very much!
0
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.