Click to See Complete Forum and Search --> : How do i create a directory??????


PanasonicSubz
November 20th, 1999, 12:56 PM
Hey peoplez! i need to make a directory, but first i need to no how!!!!!!!!! Please help me, if you want to no what i am doing read below:

First i made a splash screen then when you click or push a button, it goes to a password dialog box and asks for a password, when you type the right one in it takes you to a form, when i go to my forms code thing under "unload" i put
open "c:\phonebook\list.lst" for append as #1, that statement tells the program to write to a file when the user exits my program, but it says "path not found". I need to make it so it creates the directoy "c:\phonebook\" only 1 time. Please oh please help me

PanasonicSubz

November 20th, 1999, 05:25 PM
If you need just Directory, you can use API CreateDirectory. If you need to use second argument, look for info about SECURITY_ATTRIBUTES. If no, use this ugly code:

private Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (byval lpPathName as string, lpSecurityAttributes as SECURITY_ATTRIBUTES) as Long
private Type SECURITY_ATTRIBUTES
s as string
End Type


private Sub Command1_Click()
Dim l as Long
Dim sa as SECURITY_ATTRIBUTES
l = CreateDirectory("D:\TEEEST", sa)'it creates a folder TEEEST on drive D.
End Sub



HTH
Vlad

Lothar Haensler
November 22nd, 1999, 01:44 AM
vb has a builtin MkDir function.
mkdir "yourSubDirNameGoesHere"