Solved

Retrieve Path of an exe  in registry.

Posted on 2002-06-26
1
233 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

816 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

9 Experts available now in Live!

Get 1:1 Help Now