作者: dtom 時間: 2009-1-13 13:51 標題: 如何刪除指定日期以前的檔案/資料夾
公司有一部電腦儲存 CCTV Video,
但係個 program 唔識刪除舊資料, 攪到 hdd full 左之後個cctv就不斷 reset
有無方法 (bat / 軟件) 可以刪除指定日前以後既資料夾+檔案呢
檔案會係咁
CAM1-CAM10↓ ↓年月日 ↓年月日時分秒百分秒(其實檔案可以不理,資料夾內全部刪除都得)
D:\CCTV\CAM1\20090113\20090113133030.avi
依家每日要我手動刪除 CAM1-CAM10 7 日後既資料夾... 仲有幾個 site
作者: DrERY 時間: 2009-1-14 01:44
作者: dtom 時間: 2009-1-14 08:50 標題: 回復 2# 的帖子
就係唔想人手做
我放假就無人跟, CCTV 死左老闆又打電話黎...
作者: yo哥哥 時間: 2009-1-14 09:23
Window 2000 / XP 可以考慮用 System Tool / Scheduled Task 搭 VBScript 寫 vbs
Scheduled Task 行唔行到 bat file 我就未試過
作者: achau01 時間: 2009-1-14 09:46
If you know how to write VB or C# program, you can write a very simple program to do this. Then schedule to run your program everyday.
作者: nobodylam 時間: 2009-1-14 22:33
FYI
http://forums.techguy.org/dos-pd ... delete-folders.html
You can refer to post #9
作者: nobodylam 時間: 2009-1-14 23:06
- @Echo off
- :: User Variables
- :: Set this to the number of folders you want to keep
- Set _NumtoKeep=1
- :: Set this to the folder that contains the folders to check and delete
- Set _Path=D:\CCTV\CAM
- :: Set this to the number of cameras
- Set _NumCam=10
- For /l %%i In (1,1,%_NumCam%) Do (
- PushD %_Path%%%i
- Set _rdflag= /q
- For /F "tokens=* skip=%_NumtoKeep%" %%I In ('dir "%_Path%%%i" /AD /B /O-D /TW') Do (
- rd /s /q %%~fI
- )
- PopD
- )
