Stretch Posted May 24, 2006 Share Posted May 24, 2006 Ive got a script to look for sections in inifiles and change bits if needed - How can i get the FileFindFirstFile, FileFindnextFile function to search sub folders. *.* only searches within the current folder. Any Ideas? Stretch Link to comment Share on other sites More sharing options...
Don N Posted May 24, 2006 Share Posted May 24, 2006 FileGetAttrib() call this on every file you get using findnextfile adn if FileGetAttrib() returns "D" for directory then make a recursive call to the find files function. _____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper Link to comment Share on other sites More sharing options...
BigDod Posted May 24, 2006 Share Posted May 24, 2006 Have a look Here Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
ChrisL Posted May 24, 2006 Share Posted May 24, 2006 Search ("c:", "ini");replace with your search directory and file extension required Func Search($current,$ext) 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 StringInStr($current & "\" & $file, $ext) then MsgBox (0, "Has the file extension " & $ext, $current & "\" & $file) ;this is where you do what you need to do Endif EndIf If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then Search($current & "\" & $file, $ext) EndIf WEnd FileClose($search) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
mozart90 Posted May 24, 2006 Share Posted May 24, 2006 Hi , I remember a similar problem but . and .. were only returned in the autoit 3.1.1 NOT in the beta version. (perhaps the problem is fixed now..) greetings mozart90 Easy Zip Compression using XP Link to comment Share on other sites More sharing options...
GEOSoft Posted May 24, 2006 Share Posted May 24, 2006 Search ("c:", "ini");replace with your search directory and file extension required Func Search($current,$ext) 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 StringInStr($current & "\" & $file, $ext) then MsgBox (0, "Has the file extension " & $ext, $current & "\" & $file) ;this is where you do what you need to do Endif EndIf If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then Search($current & "\" & $file, $ext) EndIf WEnd FileClose($search) EndFunc I seem to recall reading in one of the Beta version help files that "." and ".." will no longer be returned. Regadless, a long time ago I started replacing And ($file <> "." Or $file <> "..") with And StringRight($File,1) <> "." If you are looking for folders only its If StringInStr($File,".") = 0 Then MsgBox(4096,'TEST', $File & " is a folder") George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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