How do you make a batch file to delete all files and folders in a particular folder?

1 answer

Answer

1272514

2026-04-20 00:05

+ Follow

The command is as follows :

del c:\[directory you want to delete] /s

This would need to be in a text file created in notepad, and saved as a .bat file. Or you could type EDIT from the command line to bring up the old DOS editor.

Improving answer: Step 1: Open up Notepad Step 2: Type the following code in: @echo off deltree [Your hard drive, usually C:]\[Directory you want to delete /s for quietly Step 3: Save as "whateveryouwantwithoutquotes.bat"

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.