Sign in to follow this  
Followers 0
DarkNecromancer

Dir Search

4 posts in this topic

Hya guys um i'm having trouble making a directory search function.I know all about the Filefind and those but i'm having a hard time creating a working function with it.

Ok heres what i'm trying to do. I want to have a function that will scan a folder and every subfolder looking for .exes. Easy enough but i can only get it up to the point where it finds the first folder. I dont think my codes going to cut it but i'll include it anyway.

$search = FileFindFirstFile("FOLDER TO SEARCH\*.*")   
    
    ; Check if the search was successful
     If $search = -1 Then
        Exit
     EndIf

     $core = (FOLDER STUB)
     While 1
        $file = FileFindNextFile($search) 
        If @error Then ExitLoop
        $righttext = StringRight ( $file, 4 ) 
    $swing = StringLeft ( $righttext, 1 )

    If ($file <> ".") Then
        If ($file <> "..") Then
            If ($file <> ".DS_Store") Then
                If ($file <> "Thumbs.db") Then
                     If ($swing == ".") Then
                         Msgbox(4096, "File:", $file)
                    ElseIf ($swing <> ".") Then

                        $newsearch = FileFindFirstFile(""& $core & $swing & "")
                         
                    ; Check if the search was successful
                            If $search = -1 Then
                             Exit
                            EndIf
                        
                        While 1

                    Else
                         MsgBox(4096, "Error", "Unable to determine the file type!")
                    EndIf
                EndIf
            EndIf
        EndIf
    EndIf
     WEnd

Well i hope you guys see what i'm try to do and can help me out :-\

Share this post


Link to post
Share on other sites



Don't think your if's are making much sense here.

There is also a While 1 all by itself somewhere in the middle.

On My Autoit3 Stuff there is a http://www.autoitscript.com/fileman/users/jdeb/scriptlets/findfiles.au3 ... maybe that helps ..... :idiot:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

lol yeah the readon why all that doesn't make much sense is because i don't really know how to go about coding it. Well those were what i needed. Thanks alot guess your alot of help

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