WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Directory and Deltree UDFs

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

List Directories

 Keywords: DirItemize Recurse Recursive Itemize List  Directory Folder  

#DefineFunction udfRecurseDir(Root, ItemList)
    DirList = DirItemize(StrCat(Root,"\*.*"))
    While @TRUE
        NextDir = ItemExtract(1,DirList,@TAB)
        If NextDir == "" Then Break
        DirList = ItemRemove(1,DirList,@TAB)
        NextDir = StrCat(Root,"\",NextDir)
        If ItemList == ""
         ItemList = NextDir
        Else
           ItemList = ItemList : @TAB: NextDir
        EndIf
        ItemList = udfRecurseDir(NextDir, ItemList)
    EndWhile
    Return ItemList
#EndFunction

ItemList = ""
TestDir = "C:\Windows"
dirlist = udfRecurseDir(TestDir,ItemList )
AskItemlist(testdir, dirlist, @TAB, @UNSORTED, @SINGLE)

Article ID:   W18356
Filename:   List Directories.txt
File Created: 2008:04:16:09:39:02
Last Updated: 2008:04:16:09:39:02