Saturday, 27 July 2013

Remove older file/foler by cmd


c:\>forfiles -p "path" -s -d -(number of days) -m (file/folder name) "cmd / del  /f  /q @path

Exmaple : 
i want to remove all text file who older than 2 day, and store in d:\


c:\>forfiles -p "d:\data" -s -d -2 -m *.txt -c "cmd /c del /f /q @path"

No comments:

Post a Comment