Hi,my question is how delete folder using vb
about vb
Collapse
X
-
Originally posted by jg007or using System.IO.direc tory
'directory.dele te' will delete an empty directory
Dhould the directory contasin sub directories, then you will need to recure through them to ensure all files are deleted and then delete the directory. If the directory contains files then you will recieve an error.
Private Sub Form_Load()
Dim MyDir As String
On Error GoTo ErrHandler
MyDir = "D:\Temp"
Kill MyDir & "\" & "*.*"
RmDir "D:\Temp"
Exit Sub
ErrHandler:
MsgBox Err.Number & " " & Err.Description , vbOKCancel, "This is a program generated error"
End SubComment
Comment