devxlogo

Easily Create All Directories in a Path

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 LongPrivate Sub Command1_Click()	Dim MyPath As String	Dim bResult As Long	'Specify the directory that we need	MyPath = "C:Win95TempMyFolder" & _		"MyFolderFld1Fld2"	'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 IfEnd Sub
See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist