VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

CreateDirX

Laurence Lemmon-Warde  (1 Submission)   Windows API Call/Explanation   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

This code will search the user's C:\ (or any other specified) drive for a given folder and if the folder is not found, it will call the CreateDirX function which in turn calls the API CreateDirectory function to create the specified folder. Once this is created, it will create a new notepad file within the folder and on each subsequent running of the application it will append info to this file. Great for logfile requirements!!

API Declarations
Public Declare Function CreateDirectory Lib "kernel32" Alias _
"CreateDirectoryA" (ByVal lpPathname As String, lpSecurityAttributes _
As SECURITY_ATTRIBUTES) As Long
'Insert into global module
Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Variant
bInheritHandle As Boolean
End Type

Rate CreateDirX (6(6 Vote))
CreateDirX.bas

CreateDirX Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters