Created
February 18, 2013 03:52
-
-
Save myaumyau/4975019 to your computer and use it in GitHub Desktop.
[vbs]指定されたパスのフォルダを再帰作成
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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