WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: jmburton2001 on October 07, 2019, 07:19:40 AM

Title: DirInfoToArray
Post by: jmburton2001 on October 07, 2019, 07:19:40 AM
Is there a way to have DirInfoToArray go deeper into the file structure?

I'm trying to pull artists and albums out of my music directory. The file structure is setup as "Music\Artist\Album"

(https://i.imgur.com/CtZgfYH.png)

But the best I can do with DirInfoToArray is "Music\Artist" and I'd also like to get the album.

(https://i.imgur.com/j4eBAqL.png)

Using the artist "3 Doors Down" as an example I'd like to extract:

Any tips, tricks, pointers (or sample code ;) ) would be greatly appreciated!
Title: Re: DirInfoToArray
Post by: td on October 07, 2019, 08:13:28 AM
Assuming you are using DirInfoToArray because you want more than just directory name from the function, you simply need to use recursion to walk the directory tree.  Search the Tech Database using "directory recursion" for examples.  They may not contain the "DirInfoToArray" function but the examples do demonstrate the concept of recursing through the file system.
Title: Re: DirInfoToArray
Post by: jmburton2001 on October 07, 2019, 08:35:17 AM
Thank you!