Windows 10

Batch File To Delete All Files In Folder

In this tutorial, we are going to see how to delete all files in a folder in a batch file by using DEL command. Batch file contains a series of DOS (Disk Operating System) instructions. It allows triggering the execution of commands found in this file.
 

Batch File To Delete All Files In Folder

 

 
In the following example, we have deleted all files in “myFiles” folder by using the wildcard *.*?”.

@echo off

DEL "C:\Users\StackHowTo\myFiles\*.*?"

Output:


 

Leave a Reply

Your email address will not be published. Required fields are marked *