Detecting PATH !

Posted on 1997-05-08
Last Modified: 2010-04-06
How can I detect what is the path from which I'm starting a program ? Path must include a drive letter (is's supposed to be on a CD-ROM). The program must detect where is its location .

 If you can give me a complete solution which would write the found path to a ini file let me know I will incr ease the points.
Question by:sile
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

Accepted Solution

sperling earned 80 total points
ID: 1336009
  Forms, SysUtils, INIFiles;

function StartupPath : STRING;
  Result := ExtractFilePath(Application.EXEName);

procedure PathToIni (ININame, Section, ValueName : STRING);
  INIFile : TINIFile;
  INIFile := TINIFile.Create(ININame);
  INIFile.WriteString (Section, ValueName, StrartupPath);



Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 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