Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in _menu_load_objects() (line 579 of /www/webvol38/16/9svvwb3gxs5tmhv/benzzon.se/public_html/includes/menu.inc).

BAT: Delete old files, "forfiles"..

1 post / 0 new
benzzon
benzzon's picture
BAT: Delete old files, "forfiles"..
 

ForFiles - Delete files older than 30 Days

FORFILES /P C:\MyPath\ /S /M log*.txt /D -30 /C “cmd /c del @file”

/S - look at subdirectories
log*.xml - that is the file pattern, you could have it be like *.txt for example
/D -30 = files greater than 30 days
/C - thats the command you want to run

*** Make sure to save batch-file as "DOS-text"..

Download (rename to .exe): forfiles