Solved

Retrieve Path of an exe  in registry.

Posted on 2002-06-26
1
231 Views
Last Modified: 2010-04-04
I need to find out as how to read path of the an .EXE
which is invoked when i create an OLE object which is in that .exe.
This exe path is stored in the resgistry and attached to a CLSID but somehow i am able to retrieve it.

Thanks in advance.
0
Comment
Question by:kashif063098
1 Comment
 
LVL 17

Accepted Solution

by:
geobul earned 300 total points
Comment Utility
Hi,

Try this one:

uses Registry;

function GetInprocServer32(const clsid: string): string;
begin
  result := '';
  with TRegistry.Create do begin
   try
    RootKey := HKEY_CLASSES_ROOT; { HKEY_CURRENT_USER by default }
    if OpenKey('CLSID\'+clsid+'\InprocServer32', false) then begin
      result := (ReadString(''));
      CloseKey;
    end;
   finally
    Free;
   end;
  end;
end;

// Usage:

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage(ExtractFilePath(GetInprocServer32('{08229782-89C8-4028-BB74-75BB58EF1488}')));
end;

Regards, Geo
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now