VBS递归创建多级(分级)目录文件夹

VBS脚本递归创建多级(分级)目录文件夹

CreateFolders "d:\ftptest\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递归创建多级(分级)目录文件夹