VBS中怎么利用递归创建多级目录文件夹

VBS中怎么利用递归创建多级目录文件夹,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

核心代码

CreateFolders "d:\jb51test\1\2\3\4\5" Function CreateFolders(path)Set fso = CreateObject("scripting.filesystemobject")CreateFolderEx fso,pathset fso = NothingEnd FunctionFunction CreateFolderEx(fso,path)If fso.FolderExists(path) Then Exit FunctionEnd IfIf Not fso.FolderExists(fso.GetParentFolderName(path)) ThenCreateFolderEx fso,fso.GetParentFolderName(path)End Iffso.CreateFolder(path)End Function

关于VBS中怎么利用递归创建多级目录文件夹问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注行业资讯频道了解更多相关知识。