Hi<br><br>I wish to use API-calls to create a new directory on my NTFS-volume with permissions set to something I myself choose.<br><br>I have the following code in a module - the declaration of the API-function-call takes a path (as string) to where the new folders is to be created as first parameter and second parameter is the SECURITY-settings. How do I specify this? As seen below I have found the typedeclarations with the API-viewer but I don't know how it fits together...Here's the module code:<br><br><br>Public Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long<br><br>Public Type SECURITY_ATTRIBUTES<br> nLength As Long<br> lpSecurityDescriptor As Long<br> bInheritHandle As Long<br>End Type<br><br>Public Type ACL<br> AclRevision As Byte<br> Sbz1 As Byte<br> AclSize As Integer<br> AceCount As Integer<br> Sbz2 As Integer<br>End Type<br><br>Public Type SECURITY_DESCRIPTOR<br> Revision As Byte<br> Sbz1 As Byte<br> Control As Long<br> Owner As Long<br> Group As Long<br> Sacl As ACL<br> Dacl As ACL<br>End Type<br><br><br>Next I have this in my button on a form:<br><br>' Create the new directory C:\Dummy\NewDir and<br>' give it default security attributes.<br>Dim secattr As SECURITY_ATTRIBUTES ' security attributes structure<br>Dim retval As Long ' return value<br><br>' Set the desired security attributes<br>secattr.nLength = Len(secattr) ' size of the structure<br>secattr.lpSecurityDescriptor = 0 ' default (normal) level of security<br>secattr.bInheritHandle = 1 ' this is the default setting<br><br>' Create the directory.<br>retval = CreateDirectory("C:\nyt", secattr)<br><br><br>Does anyone have any ideas as to how this would be done?<br><br>Kind regards<br><br>Siv