How do you make a batch to delete files in a certain folder?

In: Windows
[Edit]
Make a new text file and rename it to _____.bat (fill in the blank with a name of your choice). I'm assuming you know how to change file name extensions.

Right click on the .bat file. Choose 'edit'.


type this:


del " __A___ \*._B_"



fill in blank A with the directory name

fill in blank B with the extension of the file type you want to delete or '*' for all files.



EXAMPLE

del "C:\New Folder\*.*" - this will delete everything in the folder

OR

del "C:\Another Folder\*.jpg" - this will only delete files with the jpg extension




Now you can save the batch file and run it.

Improve Answer Discuss the question "How do you make a batch to delete files in a certain folder?" Watch Question

First answer by Hcross75. Last edit by Hcross75. Contributor trust: 19 [recommend contributor]. Question popularity: 17 [recommend question]

Research your answer:

Answers.com > Wiki Answers > Categories > Technology > Computers > Computer Software and Applications > Operating Systems > Windows > How do you make a batch to delete files in a certain folder?

Our contributors said this page should be displayed for the questions below. (Where do these come from)
If any of these are not a genuine rephrasing of the question, please help out and edit these alternates.
B in batch files?  Batch file to delete files?  You want to delete autoruninf folder?  How do you Batch delete files in folder?  How do you delete stuff using batch files?  How do you delete queues with a batch file?  How do you make a batch to delete files of an extension?  How do you make a Batch files to limitations of clients?  How do you make batch to delete files in certain folder?  How do you set up a batch file to copy files from one folder to another?