I am using System.IO.Directory.Delete(FilePath)
I get the the folding error
The Directory is not empty
How can I delete a directory that is not empty in vb.net 2005
Newbie in search of knowledge
I get the the folding error
The Directory is not empty
How can I delete a directory that is not empty in vb.net 2005
Code:
For Each SelectedItem As String In lbxComputerNames.SelectedItems
Dim FilePath As String
Dim UserName As String
UserName = txtUserProfile.Text.Trim
FilePath = lbxComputerNames.SelectedItem.ToString & "\c$\Documents and Settings\" & UserName
If System.IO.Directory.Exists(FilePath) Then
System.IO.Directory.Delete(FilePath)
MessageBox.Show(txtUserProfile.Text & " profile was deleted from " & UserName)
Else
MessageBox.Show(txtUserProfile.Text & " profile does not exists on " & UserName)
End If
Next
Newbie in search of knowledge