Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Retrieve Path of an exe  in registry.

Posted on 2002-06-26
1
Medium Priority
?
240 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 1200 total points
ID: 7110823
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

927 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