VBS递归创建多级目录文件夹的方法

2023-12-01 0 311

核心代码

CreateFolders \”d:\\jb51test\\1\\2\\3\\4\\5\”

Function CreateFolders(path)
Set fso = CreateObject(\”scripting.filesystemobject\”)
CreateFolderEx fso,path
set fso = Nothing
End Function

Function 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

经过测试运行没问题

VBS递归创建多级目录文件夹的方法

文中的两个函数链接CreateFolder 方法与GetParentFolderName 方法。

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 VBS VBS递归创建多级目录文件夹的方法 https://www.u-9.cn/jiaoben/vbscript/9334.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务