there is Folder object in JS with which u can scan specified location for files . U can retrieve names of files and folders , paths , sizes .etc .
You can restrict it to scan for folders only too .
var fold = new Folder("c:");
fold.typelist = ["fold"] ;
while(!fold.end){
post(fold.filename,"\n");
fold.next();
}