07-12-2007 10:39 AM
07-12-2007 04:49 PM
07-12-2007 05:09 PM
07-12-2007 11:58 PM
Ah, I understand now!
Well, you could probably write down your own function that searches the whole disk scanning the directories starting from radix of disk and using GetFirstFile / GetNextFIle functions, but it will be tedious and not so easy to debug...
In such a case I would prefere to use OS commands, for example using DIR to search the file, redirecting output to a text file and reading that last one to get the path. In your case you may create an instruction like for example LaunchExecutable ("cmd /c dir c:\\yourfile.txt /s /b > c:\\outfile.txt"): this string searches the whole disk for "yourfile.txt" and returns its full path (and nothing else
) in the output file "c:\outfile.txt". Depending on the dimension of your disk, this function may take a while (...well, a *long* while
) to execute, so you may need to use LaunchExecutableEx instead and verify in a loop that the command is terminated while you are flasking some led on the screen or updating a progress bar or so.
Look in help for DIR command options, which are a lot of and can be useful to delimit your search and speed up the process. The good thing in using this comand is that you can interactively test it without need to write down any line of code ![]()
07-13-2007 09:51 AM
07-13-2007 10:00 AM - edited 07-13-2007 10:00 AM
@Sandiver wrote:
Ok!! The function GetFirstFile only search in current path, not search in sub-folders.
That's why I told you that it's not a trivial task: you must structure a function that searches from a start path and:
![]()
The good old DOS has saved me a lot of headhaches ![]()
Message Edited by Roberto Bozzolo on 07-13-2007 05:13 PM