here... this should fix that pesky trailing "\" on the $source variable.

Code:

$source = "v:"

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

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