Click here to Skip to main content
15,793,609 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
How to delete all the files in a folder and its subfolder using batch without prompt and also i want to delete the files even its is read only.

Please help me to find solution.


Check this answer[^] from a question similar to yours.
Share this answer
please check this out the below script

set folder="D:\test"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)

please try it before you use...
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900