Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Retrieve Path of an exe  in registry.

Posted on 2002-06-26
1
Medium Priority
?
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

705 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