VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A simple way to create a directory

by Ali Atiq (5 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 26th June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A simple way to create a directory

Rate A simple way to create a directory



Option explicit
Private Sub Form_Load()
  CreateDirectory "C:\Temp1\Temp1\Temp1"
  End
End Sub

Public Function CreateDirectory(DirPath As String)
  Dim i%, tmpDir$, arSplit
  On Error Resume Next
  arSplit = Split(DirPath, "\") 'Split Dierctory path
  tmpDir$ = arSplit(0)
  For i% = 1 To UBound(arSplit)
    tmpDir$ = tmpDir$ & "\" & arSplit(i%)
    MkDir tmpDir$
  Next i%
End Function



Download this snippet    Add to My Saved Code

A simple way to create a directory Comments

No comments have been posted about A simple way to create a directory. Why not be the first to post a comment about A simple way to create a directory.

Post your comment

Subject:
Message:
0/1000 characters