Deleting all files under a directory

Dim a As String
a = "C:\New Folder"
FolderSize(a)


I used this code to pass the value to the code in the link but it didnt work.It does not delete any files in the folder.Am i passing the values properly.
 
The code provided is basically a recursive file search. Its not meant to delete files. You need to edit it yourself to delete files instead of get their size. You will also need to add some exception handling in case a file is locked and cannot be deleted.
 
Back
Top