How to Delete all files with same extension inside a folder Using Command prompt

If you want to delete or get rid of a particular type of files inside a folder, you can do so easily using Command prompt. Here is a step by step guide for doing this.


ADVERTISEMENT

For example, i want to delete all .txt files inside a folder. Lets do this.

How to Delete Files with particular extension

1. Search cmd in windows 10 search box.

2. Click on the cmd icon to open it.


ADVERTISEMENT

3. Now, browse to the folder and copy the path of the folder from the address bar.

 

Copy Address Folder Min

 

4. Now, in command prompt window, just write cd /path/of/the/file/you/just/copied

Cd Delerte File Min

 

5. Now, copy and paste the command given below to delete all .txt files.

DEL *.txt

All the .txt files will be deleted.

To force delete use /f with the command


ADVERTISEMENT

So, the new command will be

DEL  /f *.txt

Case 1 – If you want to Delete all files having some_text as a part of string

copy and paste the command given below to delete all files with name or part of name some_text

DEL  some_text*

Some Text Min

Case 2 – If you want to Delete all files having some_text and having extension .jpg

DEL  some_text*.jpg

ADVERTISEMENT

1 thought on “How to Delete all files with same extension inside a folder Using Command prompt”

Comments are closed.