Get the App
SLTechnology News&Howtos  ›  Development  › 

The usage of the VBS property IsRootFolder

Shulou Source: shulou.com Published: 2022-06-03 19:53:49 11月12日 Update

This article mainly explains "the usage of VBS attribute IsRootFolder". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the idea of Xiaobian to study and learn "the usage of VBS attribute IsRootFolder" together.

Returns True if the specified folder is the root folder; False otherwise.

object.IsRootFolder

object Folder should be the name of the object.

description

The following code illustrates how to use the IsRootFolder property:

Function DisplayLevelDepth(pathspec)Dim fso, f, n Set fso = CreateObject("Scripting.FileSystemObject")Set f = fso.GetFolder(pathspec) If f.IsRootFolder Then DisplayLevelDepth ="The specified folder is the root folder. " Else Do Until f.IsRootFolder Set f = f.ParentFolder n = n + 1 Loop DisplayLevelDepth ="The specified folder is a folder with a nesting level of" & n &." " End IfEnd Function Thank you for reading, the above is the content of "Usage of VBS attribute IsRootFolder", after learning this article, I believe everyone has a deeper understanding of the usage of VBS attribute IsRootFolder, and the specific use needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Tags: Files folders properties learning content code names objects that is ideas situations articles more knowledge knowledge points articles follow questions practice push Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Microsoft MariaDB OPPO Reno vpn