Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to find the a particular file in all drive


3 replies to this topic

shajilr

shajilr
  • Members
  • 11 posts

Posted 15 October 2002 - 07:53

Hi,
I have to find a certain file/directory is there in the user's system including all the shared drives. Could any one of you help me with this.Please note that the no of drives may vary.
Thanks,
Shajil


___
Thanks & Regards,
Shajil

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 15 October 2002 - 14:01

Good luck as unfortunately a true search of the drives will take forever and annoy users.
user posted image

vuttex

vuttex
  • Full Members
  • 35 posts

Posted 15 October 2002 - 14:06

Use the function GetValidDriveList();

Create a while loop with the list you get from GetValidDriveList. In the loop use FindAllFiles();

Could look something like this:

listID = ListCreate (STRINGLIST);
GetValidDriveList(listID, -1, -1);

nResult = ListGetFirstString (listID, svString);

FindAllFiles(svString + ":\\", szTheFileYouWantToFind, svResult, RESET);

while (nResult != END_OF_LIST)

nResult = ListGetNextString (listID, svString);

FindAllFiles(svString + ":\\", szTheFileYouWantToFind, svResult, RESET);

endwhile;

ListDestroy (listID);

(the example will search all valid drives including floppy, cd etc. it will not search for the file in multiple places)

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 15 October 2002 - 15:25

There may be other tricks to use depending on what type of file your looking to find.   Such as using the variables WINDIR and WINSYSDIR which will automatically track to where the system has them located.  Another way would be to have your installer put down the needed file where you want it.  You should obviously be careful with using the second option in certain situations :)
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)