Delete files with batch job -
i want delete .txt extention files in computer every 30 days using batch script...
files name like:
filename_20082013.txt filename_21082013.txt filename_22082013.txt filename_23082013.txt
for windows:
forfiles -p "c:\what\ever" -s -m *.* -d <number of days> -c "cmd /c del @path"
so:
forfiles -p "c:\your\path" -s -m *.txt -d -30 -c "cmd /c del @path"
source: batch file delete files older n days
this delete files @ least 30 days old (you can change number)...now need schedule task run every 30 days:
you can use windows task scheduler:
http://www.iopus.com/guides/winscheduler.htm
http://windows.microsoft.com/en-us/windows7/schedule-a-task
or can use streamserve task scheduler:
http://streamshare.streamserve.com/articles/article/?articleid=424
Comments
Post a Comment