VB script for creating a directory
I want to check if C:\Test\Log exits if not create C:\Test\Log.
I used the script to create a folder which creates only till C:\Test.
Not really sure how to create the complete path.
Please help...its highly important..Thanks
I used the script to create a folder which creates only till C:\Test.
Not really sure how to create the complete path.
Please help...its highly important..Thanks
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
itolutions
13 years ago
Sub CreateRecursiveDirectory(LocalPath)
On Error Resume Next
if Not oFSO.FolderExists(LocalPath) Then
if Not oFSO.FolderExists(oFSO.GetParentFolderName(LocalPath)) Then
CreateRecursiveDirectory(oFSO.GetParentFolderName(LocalPath))
End if
oFSO.CreateFolder(LocalPath)
Else
oFSO.GetFolder(LocalPath)
End If
On Error Goto 0
End Sub
Example of using:
CreateRecursiveDirectory "C:\bd\data\notes"
Posted by:
captain_planet
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.