Microsoft® JScript™
IsRootFolder Property
 Language Reference 
Version 3 

See Also                  Applies To


Description
Returns True if the specified folder is the root folder; False if it is not.
Syntax
object.IsRootFolder

The object is always a Folder object.

Remarks
The following code illustrates the use of the IsRootFolder property:
var fs = new ActiveXObject("Scripting.FileSystemObject");

function DisplayLevelDepth(pathspec)
{
    var f, n;
    f = fs.GetFolder(pathspec);
    if (f.IsRootFolder)
        window.alert("The specified folder is the root folder.")
    else
    {
        do
        { 
            f = f.ParentFolder;
            n++
        }
        while (!f.IsRootFolder)
        window.alert ("The specified folder is nested " + n + " levels deep.")
    }
 }

© 1997 by Microsoft Corporation. All rights reserved.