shankar_it Posted July 28, 2005 Posted July 28, 2005 can any one help me out with the command in deleting all the files under a directory in vb.net. Quote
Administrators PlausiblyDamp Posted July 28, 2005 Administrators Posted July 28, 2005 You could use the code in Clicky and just delete each file rather than getting it's size. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
shankar_it Posted July 28, 2005 Author Posted July 28, 2005 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 didn't work.It does not delete any files in the folder.Am i passing the values properly. Quote
jmcilhinney Posted July 29, 2005 Posted July 29, 2005 The code provided is basically a recursive file search. It's 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. Quote
shankar_it Posted July 29, 2005 Author Posted July 29, 2005 Thank you for the code.I have changed the code to delete files. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.