3
Contributors
2
Replies
16
Views
4 Years
Discussion Span
Last Post by rishif2
1

Try :

Private Sub Command1_Click()
If Dir$("D:\Daniweb\", vbDirectory) = "" Then
    MkDir "D:\Daniweb\"
Else
    MsgBox "Duplicate Folder"
End If
End Sub

Private Sub Command2_Click()
If Dir$("D:\Daniweb\", vbDirectory) = "" Then
    MsgBox "Folder not found"
Else
    RmDir "D:\Daniweb\"
End If
End Sub
Votes + Comments
Help me too
0

try this

Dim fso As New FileSystemObject

now code to create a folder

fso.CreateFolder "d:\newfolder"

and now code to delete a folder

fso.DeleteFolder "d:\newfolder"

before putting this code first add references and so goto project menu and then select references option and then select Microsoft Scripting Runtime

hope this helps you . . .

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.