Solved

Where is my EXE etc.

Posted on 1999-01-24
15
159 Views
Last Modified: 2010-04-06
How can I tell which directory a user has copied my programme and any associated files.
Bearing in mind no changes to registry or system settings etc. I did have this information but unfortunately problems with my computer means I have lost a hell of a lot of info.

xpher
0
Comment
Question by:xpher
  • 4
  • 3
  • 3
  • +4
15 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1363071
Hi xpher,

your program-Path and name of exe you can get with ParamStr(0)

i.e. edit1.text := paramStr(0);

for the other files you have to write a search-algorythm or protocoll it in an INI-File, if you use a InstallationRoutine.

meikl
0
 

Expert Comment

by:dr_gonzo
ID: 1363072
Use ExtractFilePath(ParamStr(0))
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1363073
Hi Dr. Gonzo,

how about reading the comments before answering questions???
I mean it's the second question today, where I see you posting an answer with not (at least significantly) more info than some other experts have given before you in comments...

Regards, Madshi.
0
 
LVL 1

Author Comment

by:xpher
ID: 1363074
Well said Madshi

kretzschmar can you post an answer it was enough to jog my memory banks.

Regards

xpher
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1363075
You can also use ExtractFilePath(Application.ExeName)...

Cheers,

Raymond.
0
 
LVL 1

Author Comment

by:xpher
ID: 1363076
Thanks rwilson I'll try that one. My other problem is sorted but many thanks.

xpher :)
0
 
LVL 1

Expert Comment

by:martin_g
ID: 1363077
If you don't know where the file(s) may be "hiding" you'll need a file finding algorithm.
Here's a rudimentary file find routine you can use. It's not original but the author published the component as freeware
Gabriel Cherem  E-mail egr7jmc@npd.ufsc.br
procedure TFileFind.SearchDirectory(FileMask:String; Path: TFileName);
function MakePath(Path,FileName:TFileName):TFileName;
begin
  Result := Path;
  if Result[Length(Result)] <> '\' then
    Result := Result + '\';
  Result := Result + FileName;
end;

var
  SearchRec: TSearchRec;
begin
  if Assigned(FOnChangeDirectory) then
    FOnChangeDirectory(Self,Path);
  { one pass for files... }
  if FindFirst(MakePath(Path,FileMask), faAnyFile, SearchRec) = 0 then
    repeat
      with SearchRec do
        if Attr <> faDirectory then begin
          FLastMatch := MakePath(Path,Name);
          if Assigned(FOnMatch) then
            FOnMatch(Self);
          if StopOnFirstMatch then
            Stopped := true
          else
            Application.ProcessMessages;
       end
      until (FindNext(SearchRec) <> 0) or Stopped;
  FindClose(SearchRec);
  { ... and another for subdirectories }
  if (SearchScope <> ssCurrentDir) or Stopped then begin
    if FindFirst(MakePath(Path,'*.*'), faDirectory, SearchRec) = 0 then
      repeat
        with SearchRec do
          if (Name <> '.') and (Name <> '..') and (Attr = faDirectory) then
            SearchDirectory(FileMask,MakePath(Path,Name));
        Application.ProcessMessages; { we have to be gentle to the others apps }
      until (FindNext(SearchRec) <> 0) or Stopped;
    FindClose(SearchRec);
  end;
  { these two loops above could become just one, but i'd  }
  { have to write a parser to resolve wildcards...        }
  { I will be gratefull if someone send me one! :)        }
end;

Hope this helps!
Martin Gauss
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Expert Comment

by:dr_gonzo
ID: 1363078
Hi Madhsi.
I always thought this place was were you helped each other,
and that fighting belonged to newsgroups.
There's a difference between comments and answers if you ask me.
I post a comment, if it is an answered out of my mind but I haven't been able to test it.

If I have test it I post it as an answer. An answer should be completely right, not half the way.
If the person asking the question does like a comment better he can do what xpher did. reject my answer and let you get the points. Thats the way it should be if your hint helped him to solve the problem. I do not have anything to say against that.

But that you here instead of in my mail acuse me of steeling point I get really mad.

So I think I can delight you and xpher. I will not use EE for anything else than my questions. I don't want to fight. Maybe someone know some good place for helping each other?

\Dr. Gonzo
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 20 total points
ID: 1363079
well xpher,

i will post this as answer, but if you like to follow the discussion or you want to get a searchalgorythm, then reject my answer.

meikl

0
 
LVL 20

Expert Comment

by:Madshi
ID: 1363080
Hi Dr. Gonzo,

I didn't mean to fight or to insult you in any way. Sorry, if you understood it this way...  :-(

I was not angry because you answered the question, but because you didn't seem to read the comments of the other experts. You must admit that your answer was not significantly better than meikl's comment was. So it was unfair to post an answer. Of course xpher could reject your answer and give meikl the points (and you see that he agrees with me here). But unfortunately a lot of questioners would just have accepted your answer. And that would have been quite unfair to meikl, since he was faster than you. I don't know why he didn't post an answer. I guess he was so polite to give xpher the possibility to check his comment before locking the question.

All I want is that you *please* read the comments before locking a question. Then if you think your answer is right and nobody else has given the same info before you (!) you should of course post an answer. Don't you think that this would be a better? Thank you...

Regards, Madshi.
0
 

Expert Comment

by:dr_gonzo
ID: 1363081
Yes. But I'm still of the opinion that his answer was a hint,
and my was an answer. Of corse if the hint was enough hi should have the point. I also believe that the questioner's are professional enough to not give points to someone who should get them. After all they are experts. So my answer has to be no i don't think that's better. Anyway this point system is kind of sick anyway, so i guess I have to set up my own newsgroup or something. byw for now...

Anyway thanks for not insulting me. :->

Regards,
Dr. Gonzo
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1363082
Hi Madshi, hi dr_gonzo,

i do principal a possible answer in a comment, so that the questioner can evaluate it. But not all questioner are professional enough to see that a comment is closer to the solution than a answer. It happens to me often that the questioner commented that my comment had solved his problem and he accepts a answer from a other Expert (Frusted).

But i'm not here to cellect Points, of course i am afraid about given points to me, it's for Fun, for my Brain, for helping others, for learning from others.

meikl :-)
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1363083
:-)

I do agree with you, except this point:
>> I also believe that the questioner's are professional enough
>> to not give points to someone who should get them.

Fortunately, a lot of questioners are professional enough. But believe me, a lof of questioners are NOT! It happended several times to me, that other experts posted the same answer (or even a worse) as I've written in a comment before - and nevertheless got "my" points. Of course, it's not so important (we can't buy anything with the points), but it's somehow a little bit frustrating...
That's why I sometimes get angry about experts who don't seem to read the comments...

Regards, Madshi.
0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1363084
You can "buy" an EE t-shirt with 5000 expert points, and you even get to keep the points! I'm wearing mine right now.

See http://www.experts-exchange.com/info/tshirt.htm

0
 
LVL 20

Expert Comment

by:Madshi
ID: 1363085
Hi Philip, thank you for the tip...   :-)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

12 Experts available now in Live!

Get 1:1 Help Now