本帖最后由 920168 于 2011-10-20 12:02 编辑
没有测试,希望大家看到代码别笑,就这水平!3楼的代码我写之前没有理解LZ的意思!谢谢“545810831 ”提醒!!- echo off
- cls
- echo wscript.echo dateadd("d",-10,date)>GetOldDate.vbs
- for /f "tokens=1,2,3* delims=-/. " %%i in ('cscript /nologo GetOldDate.vbs') do (
- set y=%%i
- set m=%%j
- set d=%%k
- )
- if %m% LSS 10 set m=0%m%
- if %d% LSS 10 set d=0%d%
- set OldDate=%y%-%m%-%d%
- del GetOldDate.vbs
- for /r %%a in (*.rar) do for /f "tokens=1,2* delims= " %%b in (
- 'dir /tc "%%a" ^| find /i "%%~nxa"') do (
- if "%%b" lss "%OldDate%" echo "%%a">>10.txt
- )
- IF not EXIST "10.txt" exit
- ::
- for /r %%a in (*.rar) do if %%~za gtr 209715200 echo "%%a">>200.txt
- for /r %%a in (*.rar) do if %%~za LSS 104857600 echo "%%a">>100.txt
- IF not EXIST "200.txt" cd.>200.txt
- IF not EXIST "100.txt" cd.>100.txt
- copy /b 200.txt + /a 100.txt 200100.txt
- del /q /s 200.txt
- del /q /s 100.txt
- ::
- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('type "10.txt"') do (
- set var1=%%i
- for /f "delims=" %%a in ('type "200100.txt"') do (
- set var2=%%a
- if /i "!var2!"=="!var1!" echo !var1!>>del.txt
- ))
- del /q /s 200100.txt
- del /q /s 10.txt
- ::
- @echo off & setlocal EnableDelayedExpansion
- set j=0
- for /f "delims=""" %%i in (del.txt) do (
- set /a j+=1
- set con!j!=%%i
- call set a=%%con!j!%%
- del /Q /s !a!
- )
- del /q /s del.txt
复制代码
|