In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "the use of GetParentFolderName method in VBS". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "the use of GetParentFolderName method in VBS"!
GetParentFolderName method
Returns a string containing the parent folder of the last file or folder in the specified path.
Object.GetParentFolderName (path)
Parameters.
Object
Required. Should be the name of FileSystemObject.
Path
Required. Specify the path to return the parent folder name of the file or folder.
Description
If the file or folder specified by the path parameter has no parent folder, the GetParentFolderName method returns a zero-length string (").
The following example illustrates how to use the GetParentFolderName method:
Function GetTheParent (DriveSpec) Dim fsoSet fso = CreateObject ("Scripting.FileSystemObject") GetTheParent = fso.GetParentFolderName (Drivespec) End Function
Note that the GetParentFolderName method only works on strings that provide path. It cannot attempt to analyze a path, nor can it check whether the specified path exists.
For more details, please refer to this article: https://www.jb51.net/shouce/vbs/vsmthGetParentFolderName.htm
Let me share one with you.
VBS script recursively creates a multi-level (hierarchical) directory folder
CreateFolders "d:\ ftptest\ 1\ 2\ 3\ 4\ 5" Function CreateFolders (path) Set fso = CreateObject ("scripting.filesystemobject") CreateFolderEx fso,path set fso = NothingEnd FunctionFunction CreateFolderEx (fso,path) If fso.FolderExists (path) Then Exit Function End If If Not fso.FolderExists (fso.GetParentFolderName (path)) Then CreateFolderEx fso,fso.GetParentFolderName (path) End If fso.CreateFolder (path) End Function
It mainly uses the principle of recursive call to achieve step-by-step directory creation.
At this point, I believe you have a deeper understanding of "the use of the GetParentFolderName method in VBS". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
Is the word length of the server to be installed by PHP; x8
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.