::D elete folder::by ZF 20151019echo off&setlocal enabledelayedexpansion:beginset folder_path=d:\deleteset/p folder_date= "Pls input valid date (7| | 2015/10/19): ":: Set folder_date=30::forfiles/p%folder_path%/s/m zte*/d-2015/10/15forfiles/p%folder_path%/d-%fold Er_date%/M lh_*if not%errorlevel%==0 goto exset/p yn= "is you sure delete the folder above (y/n):" If%yn%==y goto ST::I F%yn%== "y" goto stpauseexit:stforfiles/p%folder_path%/d-%folder_date%/M lh_*/C "cmd/c rd/s/q @path: Expauseexit
Interactive manual removal.
::D elete folder::by ZF 20151019echo off&setlocal enabledelayedexpansion:beginset folder_path=d:\deleteset folder_ Date=3::set folder_date=30::forfiles/p%folder_path%/s/m zte*/d-2015/10/15forfiles/p%folder_path%/d-%folder_date %/M lh_*if%errorlevel%==0 goto stexit:stforfiles/p%folder_path%/d-%folder_date%/M lh_*/C "cmd/c rd/s/q @path
Can be added to a scheduled task and processed on a regular basis. window2003 under test pass.
PS: There is known to be able to delete the folder periodically (by file name delete), such as, test20151001_1 can guide me.
There must be Xie in the auspicious.
Bat Script-Delete a folder that has been modified for too long the main use of forfiles