hope this helps...

Code:

$source = "v:\"

if right($source,1) <> "\" $source = $source + "\" endif

dim $1[0]
dim $2[0]
dim $3[0]

$folders = dirplus($source,"/ad /s2")
for each $f in $folders
select
case ubound(split(split($f.path,$source)[1],'\')) = 0
;? "level - 1 " + $f.path
$1[ubound($1)] = $f.path
redim preserve $1[ubound($1)+1]

case ubound(split(split($f.path,$source)[1],'\')) = 1
;? "level - 2 " + $f.path
$2[ubound($2)] = $f.path
redim preserve $2[ubound($2)+1]

case ubound(split(split($f.path,$source)[1],'\')) = 2
;? "level - 3 " + $f.path
$3[ubound($3)] = $f.path
redim preserve $3[ubound($3)+1]
endselect
next

if ubound($1) redim preserve $1[ubound($1)-1] else $1 = 0 endif
if ubound($2) redim preserve $2[ubound($2)-1] else $2 = 0 endif
if ubound($3) redim preserve $3[ubound($3)-1] else $3 = 0 endif

?'1 lvl deep from "' + $source + '"'
for each $thing in $1
? $thing
next
?
?'2 lvl deep from "' + $source + '"'
for each $thing in $2
? $thing
next
?
?'3 lvl deep from "' + $source + '"'
for each $thing in $3
? $thing
next



Edited by Bryce (2005-11-04 10:48 PM)