Hi all,

As i mentioned in thread title, i want to create and delete folder.
How i can create and delete folder/directory with vb6.

Please help

Recommended Answers

All 2 Replies

Try :

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

Private Sub Command2_Click()
If Dir$("D:\Daniweb\", vbDirectory) = "" Then
    MsgBox "Folder not found"
    RmDir "D:\Daniweb\"
End If
End Sub
commented: 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 . . .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.