![]() And if you want to delete files NEWER than 30 days, you need to specify /D “ 30”. Note that if you want to delete files OLDER than 30 days, you need to specify /D “-30”. /C specify the command to execute for each file, in this case we have specified “cmd /c del is the full path, including name./m select files matching the specified wildcard, *.* means all file regardless of the file extension.Syntax: forfiles /p "C:\path\to\dir" /s /m *.* /D - /C "cmd /c del /p “C:\path\to\dir” is the the path to the directory where files to delete exists (default=current folder) It allows triggering the execution of commands found in this file. ![]() Batch file contains a series of DOS (Disk Operating System) instructions. In this tutorial, we are going to see how to delete all files in a folder older than N days in a batch file by using FORFILES command, which allows you to execute a command on each file selected.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |