Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Sep 10, 1998



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Easily Create All Directories in a Path

Use this code to create a tree of folders on Windows 95 or NT 4.0 in one line:
 Private Declare Function _
	MakeSureDirectoryPathExists Lib "IMAGEHLP.DLL" _
	(ByVal DirPath As String) As Long
Private Sub Command1_Click()
	Dim MyPath As String
	Dim bResult As Long
	'Specify the directory that we need
	MyPath = "C:\Win95\Temp\MyFolder\" & _
	'Now create that directory if it does exist. 
	'The entire path will be created if needed 
	bResult = MakeSureDirectoryPathExists(MyPath)
	'Test for failure
	If bResult = 0 Then
		MsgBox "MakeSureDirectoryPathExists failed!"
	End If
End Sub
Mordechai Eli
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date