CryoEnix Posted February 5, 2005 Posted February 5, 2005 I know about the Kill() and RmDir functions, but RmDir only works if the folder is empty. Is there a special command to delete a folder, with contents or not? Quote Chaos is merely logic beyond human comprehension
coldfusion244 Posted February 5, 2005 Posted February 5, 2005 I know about the Kill() and RmDir functions' date=' but RmDir only works if the folder is empty. Is there a special command to delete a folder, with contents or not?[/quote'] Back in the day, you would use rmdir /s /q [dir], /q doesn't prompt user, and /s deletes all files and subdirectories.... Don't know how that'll help you, but the switches are there. Quote -Sean
Wile Posted February 5, 2005 Posted February 5, 2005 The Delete method of the Directory object has an overload that allows you to specify if you want a recursive delete, that also deletes the files and subfolders in the directory: System.IO.Directory.Delete(String, Boolean) Quote Nothing is as illusive as 'the last bug'.
CryoEnix Posted February 6, 2005 Author Posted February 6, 2005 Cheers Wile, it works fine! Quote Chaos is merely logic beyond human comprehension
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.