核心代碼
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
CreateFolders "d:\zzvipstest\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)過(guò)測(cè)試運(yùn)行沒(méi)問(wèn)題
文中的兩個(gè)函數(shù)鏈接CreateFolder 方法與GetParentFolderName 方法。
原文鏈接:https://blog.csdn.net/piaoyunlive/article/details/89084923