Autobater Posted May 19, 2009 Share Posted May 19, 2009 Try this code.. I do all kinds of file searching and this type of code hasn't failed me yet...CODEfindDocs("c:\","")Func findDocs($s_path, $child_dir) $search = FileFindFirstFile($s_path & $child_dir & "*.*") While 1 $s_filename = FileFindNextFile($search) If @error Then ExitLoop $filename = $s_path & $child_dir & $s_filename If StringInStr(FileGetAttrib($filename), "D") <> 0 Then ;Check if it is a directory by seraching the file properties findDocs($s_path, $child_dir & $s_filename & "\") EndIf If StringInStr($filename,".doc") Then WriteLog($s_path & $child_dir & $filename) EndIf WEndEndFuncFunc WriteLog($line) $outFile = FileOpen("c:\myDocsLog.txt", 9) FileWriteLine($outFile, $line) FileClose($outFile) Return 0EndFunc 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