Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

VBScript Folder Object IsRootFolder Property

Returns True if the specified folder is the root folder; False if it is not.

Syntax: VBScript Folder Object IsRootFolder Property

object.IsRootFolder

Arguments: VBScript Folder Object IsRootFolder Property

object

A Folder object.

Remarks: VBScript Folder Object IsRootFolder Property

The following code illustrates the use of the IsRootFolder property:

Dim fs

Set fs = CreateObject("Scripting.FileSystemObject")

Sub DisplayLevelDepth(pathspec)

Dim f, n

Set f = fs.GetFolder(pathspec)

If f.IsRootFolder Then

MsgBox "The specified folder is the root folder."

Else

Do Until f.IsRootFolder

Set f = f.ParentFolder

n = n + 1

Loop

MsgBox "The specified folder is nested " & n & " levels deep."

End If

End Sub

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.