Sign in to follow this  
Followers 0
BALA

Help debugging with functions

1 post in this topic

#1 ·  Posted (edited)

I found this code while searching the Internet I thought I could probably create a GUI and modify it a bit to fit my needs.

;Recursive File Lister
 
Dim $FolderName = "C:\WINDOWS\SYSTEM32"
Dim $FileCount = 0
 
ScanFolder($FolderName)
 
MsgBox(0,"Done","Folder Scan Complete.  Scanned " & $FileCount & " Files")
 
Func ScanFolder($SourceFolder)
    Local $Search
    Local $File
    Local $FileAttributes
    Local $FullFilePath

    $Search = FileFindFirstFile($SourceFolder & "\*.*")
 
    While 1
        If $Search = -1 Then
            ExitLoop
        EndIf

        $File = FileFindNextFile($Search)
        If @error Then ExitLoop

        $FullFilePath = $SourceFolder & "\" & $File
        $FileAttributes = FileGetAttrib($FullFilePath)

        If StringInStr($FileAttributes,"D") Then
            ScanFolder($FullFilePath)
        Else
            LogFile($FullFilePath)
        EndIf
 
    WEnd
 
    FileClose($Search)
EndFunc
 
Func LogFile($FileName)
    FileWriteLine(@ScriptDir & "\FileList.txt",$FileName)
    $FileCount += 1
    ToolTip($FileName,0,0)
EndFuncoÝ÷ ØÚ0Ûzk-¢É"¦Ø^jëh×6ScanFolder($FolderName)

The answer is probably really simple, but i am a n00b so what do you expect. :P

(Man, I miss the GOTO command...)

P.S. I think it has something to do that I didn't include a command to read the input.

EDIT: Found error, sorry. :D

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

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