How do you delete a folder and everything in it from cmd?

rmdir says the directory is not empty and del only removes the files, leaving all the subfolders behind. Need one command for a script.
1

Leave A Reply

Log in to post an answer.

1 Answer

nikhil_15 Oct 29, 2026
rumpa_gadget
rmdir /s /q "C:\path\to\folder" /s takes everything inside it, /q skips the are-you-sure prompt. No recycle bin, so double check the path. If it errors on some files, something has them open, close that program and run it again.