Jump to content

For each file in a directory


elite
 Share

Recommended Posts

I've had a bit of a search for this but haven't turned up any conclusive results...

How can I perform a function on each file in a directory - I'm guessing while or for, but I don't see how to put all of these in an array and iterate through them - or have I got the wrong end of the stick?

TIA

Link to comment
Share on other sites

straight from help

#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir)
If (Not IsArray($FileList)) and (@Error=1) Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf
_ArrayDisplay($FileList,"$FileList")

8)

Point taken :o

Wood for the trees...

Thanks for taking the time for a noob

Link to comment
Share on other sites

Hi,

If you need more control and recursing, there are a number of solutions in the thread, link in my signature for "recurse"

Best, Randall

I'm only need the files one directory deep - but the link is bookmarked and has given me ideas for expansion

tnx

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...