Skip to content

Instantly share code, notes, and snippets.

@myaumyau
Created February 18, 2013 03:52
Show Gist options
  • Save myaumyau/4975019 to your computer and use it in GitHub Desktop.
Save myaumyau/4975019 to your computer and use it in GitHub Desktop.
[vbs]指定されたパスのフォルダを再帰作成
Option Explicit
If WScript.Arguments.Count = 3 Then
Call CreateFolder(WScript.Arguments.Item(0))
End If
Sub CreateFolder(strPath)
Dim objFso
Dim strParentPath
Set objFso = CreateObject("Scripting.FileSystemObject")
strParentPath = objFso.GetParentFolderName(strPath)
If Not objFso.FolderExists(strParentPath) Then
Call CreateFolder(strParentPath)
End If
If Not objFso.FolderExists(strPath) Then
objFso.CreateFolder(strPath)
End If
Set objFso = Nothing
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment