Added: Apr 28, 2002
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo
Windows API Guide: CreateDirectory Function Platforms: Win 32s, Win 95/98, Win NT CreateDirectory creates a new directory on a disk. It will also set the directory's security attributes if the operating system supports it (Windows NT does, but Windows 95/98 doesn't). The function returns 1 if successful, or 0 if an error occured. lpPathNameThe name of the new directory to create. lpSecurityAttributesThe security attributes to give to the new directory, if the operating system supports it.
Highlight all by clicking in box
Declare Function CreateDirectory Lib "kernel32.dll" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long
' Create the new directory C:DummyNewDir and
' give it default security attributes (If Win '95/98, they'll be ignored anyway.)
Dim secattr As SECURITY_ATTRIBUTES ' security attributes structure
Dim retval As Long ' return value
' Set the desired security attributes
secattr.nLength = Len(secattr) ' size of the structure
secattr.lpSecurityDescriptor = 0 ' default (normal) level of security
secattr.bInheritHandle = True ' this is the default setting
' Create the directory
retval = CreateDiectory("C:DummyNewDir", secattr);
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.