Jump to content

Recommended Posts

Posted

This do you?

Search ("C:\","advapi32.dll");replace with your search directory and file required

Func Search($current,$toFind)
    If StringRight($current,1) = "\" then $current = StringTrimRight($current,1)
    Local $search = FileFindFirstFile($current & "\*.*")
    While 1
        Dim $file = FileFindNextFile($search)
        If @error Or StringLen($file) < 1 Then ExitLoop
        If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then

            IF $file = $toFind then Msgbox(0,"File found", $current & "\" & $file); you could add it to an array delete it or whatever else you wanted to do with it here
                
        EndIf
        If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then
            Search($current & "\" & $file, $toFind)
            
        EndIf
        
    WEnd
    FileClose($search)

EndFunc
Posted

@ ChrisL

hey! Thanks man, you are doing good.

one more thing: can i add more dirs/files?

Your lucky I'm feeling hypo today muttley

Local $filesToFind[4] = [3,"advapi32.dll","advpack.dll","audiodev.dll"]

Search (@windowsDir,$filesToFind);replace with your search directory and file required
Search (@DesktopDir,$filesToFind)
Search ("D:\",$filesToFind)



Func Search($current,ByRef $toFind)
    If StringRight($current,1) = "\" then $current = StringTrimRight($current,1)
    Local $search = FileFindFirstFile($current & "\*.*")
    While 1
        Dim $file = FileFindNextFile($search)
        If @error Or StringLen($file) < 1 Then ExitLoop
        If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then
            
            If IsArray($toFind) then 
                For $i = 1 to Ubound($toFind) -1
                    IF $file = $toFind[$i] then Msgbox(0,"File found", $current & "\" & $file); you could add it to an array delete it or whatever else you wanted to do with it here
                Next
            Else
                
                IF $file = $toFind then Msgbox(0,"File found", $current & "\" & $file); you could add it to an array delete it or whatever else you wanted to do with it here
            EndIf
            
                
        EndIf
        If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then
            Search($current & "\" & $file, $toFind)
            
        EndIf
        
    WEnd
    FileClose($search)

EndFunc

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
×
×
  • Create New...