Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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?
Chaos is merely logic beyond human comprehension
Posted
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.

-Sean
Posted

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)

Nothing is as illusive as 'the last bug'.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...