Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Batch Delete Files on Windows 10

Learn how to batch delete files on Windows 10 with clear steps, practical tips, and troubleshooting advice for a smoother, more reliable result.

Table of Contents

This practical guide walks through how to batch delete files on Windows 10, explains the main requirements, and highlights common issues that may appear along the way.

1. Batch delete files by Command Prompt

Command Prompt has two powerful file deletion commands: DEL and rmdir.

DEL is quite easy to understand is the command to delete a file, while rmdir is the command to delete the entire directory. You can add parameters to both commands to delete and remove specific file types, or simply delete everything.

Warning:

The rmdir command is very powerful and potentially dangerous. It removes the entire directory, including the file structure and everything in it. If you delete an important folder using this command by mistake, you may have to reinstall Win.

Delete a single file

To delete a file, use the following command:

del C:enteryourpathhere /f /s

The basic command locates the specified directory, while the / s parameter will delete all the files contained in the subdirectories and the / f parameter ignores any read-only settings.

Alternatively, go to the folder containing the files you want to delete, press Shift + Right click and select Open a command window here . Then, type "del [filename]" and press Enter.

Delete a specific file type

What To delete a specific file type from a directory? You can do that by using the following command:

del * .extension

Change "extension" to the file type you want to delete.

You can extend the command to remove all specific file extensions from subfolders with the addition of some parameters:

del /s /q *.extension

Alternatively, To delete multiple file types, you can add multiple types of extensions:

del /s /q *.png *.svg

Delete a specific file type — How to Batch Delete Files on Windows 10

Delete files and folders

The preceding commands leave the file structure behind, which can be frustrating To batch delete everything. To delete folders with files, you can use the following commands:

del /f /s /q C:enteryourpathhere > nul rmdir /s /q C:enteryourpathhere

There are a few other parameters shown here. Nul is a special file that removes all data written to it, meaning that a somewhat time-consuming enumeration process will not be written to the file, while / q chooses "silent mode".

2. Batch delete files using batch file

A cell batch file is a script you can run to perform certain tasks on your system. If you know how to create a sequence of commands, you can build a long script to automate tasks and save time. In this case, the article will use some basic commands to write batch delete commands.

For this example, we will delete the MUO Batch Rename folder we created for the previous examples. Right click on the desktop and go to New> Text Document . Name it BatchDelete and open it.

The batch file example requires you to know which directory you want to delete the file in. This sounds obvious, but you need the exact file path of the directory.

If you are unsure of the correct path for the folder, right-click and choose Properties , see the location there. Or, browse to the folder and click once in the address box to show the directory path directly.

Either way, make sure you have the correct directory as it will be wiped from the system soon.

You can copy and paste the following into your batch file. You should replace "enteryourpathhere" with the directory path.

cd C:enteryourpathhere del * /S /Q rmdir /S /Q C:enteryourpathhere

After you copy, paste and add the path to the folder, choose File> Save . Now, find your BatchDelete.txt file and press F2 to rename the file. Change the file extension from .txt to .bat and press Enter when you get a warning.

Congratulations, you've just created your first batch file!

Please note that you will have to update the directory path when you want to use the batch file again.

Key Takeaways

Use the information above as a practical reference for how to batch delete files on Windows 10. Review each step carefully, confirm any requirements, and choose the option that best fits your situation.

FAQ

What does this guide explain about Batch Delete Files on Windows 10?

It explains the main concepts, practical considerations, and useful steps related to batch delete files on Windows 10 without requiring advanced knowledge.

Who can benefit from learning about Batch Delete Files on Windows 10?

This information is useful for readers who want a clear overview, practical guidance, and reliable steps related to batch delete files on Windows 10.

What should I check before applying this information?

Review the requirements, confirm that your device, software, or situation matches the instructions, and back up important data before making major changes.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.