VBS遞歸創(chuàng)建多級目錄文件夾的方法
發(fā)布日期:2021-12-26 15:45 | 文章來源:腳本之家
核心代碼
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
經(jīng)過測試運行沒問題

文中的兩個函數(shù)鏈接CreateFolder 方法與GetParentFolderName 方法。
版權聲明:本站文章來源標注為YINGSOO的內容版權均為本站所有,歡迎引用、轉載,請保持原文完整并注明來源及原文鏈接。禁止復制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務器上建立鏡像,否則將依法追究法律責任。本站部分內容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學習參考,不代表本站立場,如有內容涉嫌侵權,請聯(lián)系alex-e#qq.com處理。
相關文章
關注官方微信