by Brandon (46 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 7th November 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Remove a directory from your hard drive
Private Sub Command1_Click ()
'remove specified directory
On Error Goto ErrHandler:
strDirectory = InputBox("Enter the directory you wish to remove","Directory")
'remove directory
RmDir (strDirectory)
Msgbox "Directory " & strDirectory & " has been removed", vbSystemModal + vbOkOnly, "Directory Removed"
ErrHandler:
Msgbox Err.Number & "This directory does not exist, please re-enter a valid path", vbExclamation + vbOkOnly,"Invalid Directory"
End Sub