Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileFindFirstFile() 1

Status
Not open for further replies.

FlamingClaw

Programmer
Jan 1, 2009
1
HU
Hello for everyone![peace]
I'm working a great project,that's name is "Unatended WindowsXp"[pc3]
The idea is not really new,and not is mine,but I can do that too...Some files during Windows setup will be copying to the 'TempInstall' dir of the system drive.They'll be installing silently.And here comes my little problem:after installation I wanna delete this temprorary setup files from the system drive...So the question is there any function or procedure that uses the following things like these:[thumbsup]

"FileFindFirstFile()"seekin' of the setup files,and when it find one then a new function should goes like "FileFindNextFile()" that will be keep searching for the remaining files .....

These codes can be write in 'AUTOIT' scripting but I wanna to write that in Pascal.....
Someone could help me?
 
Hi

In Pascal you have [tt]FindFirst[/tt] and [tt]FindNext[/tt] in the [tt]dos[/tt] unit.
Code:
  [b]uses[/b] dos;
  [b]var[/b] sea:SearchRec;
[b]begin[/b]
  FindFirst([i]'tempdir\*.*'[/i],AnyFile,sea);
  [b]while[/b] DosError=0 [b]do[/b] [b]begin[/b]
    Write(sea.name,[i]' is a '[/i]);
    [b]if[/b] sea.attr and Directory=Directory [b]then[/b] Writeln([i]'directory'[/i]) [b]else[/b] Writeln([i]'regular file'[/i]);
    FindNext(sea);
  [b]end[/b];
[b]end[/b].

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top