vbs 创建多级目录方法

Sub create(fso,path)
  If fso.FolderExists(path) Then
   Exit Sub
  End If
  If Not fso.FolderExists(fso.GetParentFolderName(path)) Then
   create fso,fso.GetParentFolderName(path)  
  End If
  fso.CreateFolder(path)
End Sub

 

Set fso = CreateObject("scripting.filesystemobject")
create fso,"c:/a/a/a/a/a/a/a/"
set fso = Nothing

 

你可能感兴趣的:(vbs)