Raestlin Posted August 25, 2006 Posted August 25, 2006 I can perform a simple DOS command like "dir *tub* /s" and it will scan the currently directory as well as all subdirectories and return a listing of all directories and filenames that contain the word "tub" in them. I can't find anything in AutoIt that will do the same thing. I can always call a DOS command from within AutoIt, but I was hoping someone has discovered a way to access files from within AutoIt without dumping out to DOS? I checked out the FileFindFirstFile & FileFindNextFile commands, but they won't work, because 1) they don't recurse subdirectories and 2) they don't allow two wildcards on one side of the extension. Thanks, ~ Chris
vim Posted August 25, 2006 Posted August 25, 2006 (edited) Look here:http://www.autoitscript.com/forum/index.ph...st&p=211812 Edited August 25, 2006 by vim
BigDod Posted August 25, 2006 Posted August 25, 2006 FileFindFirstFile & FileFindNextFile commands do accept 2 wildcards before the extension, least ways they do on mine. Search for recursive in scripts and scraps and you will find a script that you can modify. 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
Valuater Posted August 25, 2006 Posted August 25, 2006 i use similar dos commands for similar reasons..... and they work great 8)
Zedna Posted August 25, 2006 Posted August 25, 2006 Or you can use UDF functions _FileListToArray()from standard include file \include\File.au3 Resources UDF ResourcesEx UDF AutoIt Forum Search
Valuater Posted August 25, 2006 Posted August 25, 2006 as far as i have found _FileListToArray() only goes 1 level deep into sub folders 8)
lod3n Posted August 25, 2006 Posted August 25, 2006 (edited) #include <Constants.au3> $foo = Run(@ComSpec & " /c dir *tub* /s /b", @ScriptDir, @SW_HIDE, $STDOUT_CHILD) $output = "" While 1 $output &= StdoutRead($foo) If @error Then ExitLoop Wend $output = StringStripWS($output,3) $aTubs = StringSplit ($output, @crlf,3) for $i = 1 to $aTubs[0] $curtubfile = $aTubs[$i] msgbox(0,"Found tubfile:",$curtubfile) next Edited August 25, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
Raestlin Posted August 25, 2006 Author Posted August 25, 2006 BigDod said: FileFindFirstFile & FileFindNextFile commands do accept 2 wildcards before the extension, least ways they do on mine.Search for recursive in scripts and scraps and you will find a script that you can modify.Thanks BigDod.I searched for recursive and found a pretty good script sample that will work great for what I need. :-)
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