Sign in to follow this  
Followers 0
monte

Find File

9 posts in this topic

Hello, I need to search the drive for a file and return to full path to the file found. Is there a way to do this?

The code found in the manual only searches the current directory and doesn't decend into subsequent directories nor does it return the full path. Any thoughts? Thanks.

; Shows the filenames of all files in the current directory, note that "." and ".." are returned.
$search = FileFindFirstFile("*.*")  

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    
    MsgBox(4096, "File:", $file)
WEnd

; Close the search handle
FileClose($search)

Share this post


Link to post
Share on other sites



I could make a script to do this for you in Windows XP or DOS. What OS are you on, though?

Do you want to just find one file, or many files? Like a que of keywords to find and report on?

Share this post


Link to post
Share on other sites

foaman, I'm running xp ( I would like it to work with 2000 as well. Thanks.

gafrost, will do.

Share this post


Link to post
Share on other sites

Sorry, Foaman. I want to find just one file.

Share this post


Link to post
Share on other sites

I've tried running C:\find /I "filename" and outputting it to a file then parsing that file from within autoit, but it takes too long to run find. Any other ideas? Thanks.

Share this post


Link to post
Share on other sites

gafrost, I didn't find anything useful in scripts and scraps. Did you see something specific to my question?

Share this post


Link to post
Share on other sites

thanks valuater.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0