|
-
Oct 7th, 2002, 07:52 PM
#5
Thread Starter
Lively Member
To JordanChris
I manage to create A:\PG\CW folder but unable to create date folder that the user specified.
Fyi Bck means backup...i need to do backup for the existing folders and files. Below are my snippet for creating folder.
---------------------------------------------------------------------------------
Public Sub PG_Md()
Dim InitPath, BckDir, DirFlag As String
'---------------------------------------------------------
'Initialise Variable
DirFlag = "N"
'Define Search Directory
InitPath = "A:\PG\"
BckDir = Dir(InitPath, vbDirectory)
'Search for PG\CW directory
Do While BckDir <> ""
If BckDir <> "." And BckDir <> ".." Then
If GetAttr(InitPath & BckDir) = vbDirectory Then
If BckDir = "CW" Then
DirFlag = "Y"
End If
End If ' it represents a directory.
End If
BckDir = Dir
Loop
' Create CW if not found
If DirFlag = "N" Then
MkDir "A:\PG\CW"
End If
End Sub
--------------------------------------------------------------------------------
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|