Jump to content

File Spider


Recommended Posts

; Shows the filenames of all files in the current directory.

$search = FileFindFirstFile("C:\Windows\*.*")  
$i = 1
ProgressOn("", $search, $i)
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
    $i = $i + 1
    ProgressSet(100, $i, $file)
WEnd

ProgressOff()
MsgBox(0, "", "Found: " & $i)
FileClose($search)

I can't get it to switch folders. Does anybody know how to get that to work?

I want it to scan the whole computer for files. Go in a folder count the files, then leave the folder, and go to the next. Then when it runs out. Go back to the C:\ folder, and move to the next. Anybody know?

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

You want to make it a RECURSIVE function (a function that calls itself). Each time it searches a directory, it must list any sub directories and call itself again to search that. Each iteration must pass the results back to the one that called it.

This has been done and posted (many times) before. Search the forum for "+search +recursive".

:rolleyes:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You want to make it a RECURSIVE function (a function that calls itself). Each time it searches a directory, it must list any sub directories and call itself again to search that. Each iteration must pass the results back to the one that called it.

This has been done and posted (many times) before. Search the forum for "+search +recursive".

:rolleyes:

hi, try this;

shows files and folders;

or 2nd one choices

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...