Skrip Posted June 19, 2007 Share Posted June 19, 2007 (edited) ; 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 June 19, 2007 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 More sharing options...
PsaltyDS Posted June 19, 2007 Share Posted June 19, 2007 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". 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 More sharing options...
randallc Posted June 19, 2007 Share Posted June 19, 2007 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". hi, try this;shows files and folders;or 2nd one choices ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now