Hello Blair,

I know almost nothing about Jscript but the following script will show 
all your folders on C:\\
Copy the following code into a txt document and save it as jscript file 
*.js and than just doubleclick on it.

//--------------------------Code---------------------------------------------

function GetSubFolderNames(Path,Tag)
{
    var FSO = new ActiveXObject("Scripting.FileSystemObject");
    WshShell = new ActiveXObject( "WScript.Shell" );
    var Folder = FSO.GetFolder(Path);
    var FolderEnumerator = new Enumerator(Folder.SubFolders);
    var Foldernames = "";
    for(; !FolderEnumerator.atEnd(); FolderEnumerator.moveNext()){
        Folder = FolderEnumerator.item();
        var Len = Folder.Name.length;
        var tagLen = Tag.length;
        if(Folder.Name.substring(Len-tagLen, Len) == Tag){
            Foldernames += Folder.name.substring(0, Len-tagLen) + "\n";
        }
    }
    return Foldernames.substring(0, Foldernames.length-1);
}

WshShell = new ActiveXObject( "WScript.Shell" );
Path = "C:\\";
Tag = "";
WScript.echo("Folders on C: \n\n" + GetSubFolderNames(Path, Tag));

//--------------------------End 
Code-------------------------------------------




Blair wrote:
> Aron,
>
> Thank you for testing it out.
>
> I guess it is something specific in my sytem.  At least I know that now.
>
> I will keep testing..
>
> If you have much experience with JScript, can you give me any pointers?
>
> Thaanks Again.
>
> I really appreciate your help and testing.
>
> Blair
>
>   

Reply via email to