回复 1# yp2121540 - @echo off
- setlocal enabledelayedexpansion
- REM 设置开始日期
- set start=2019-01-01
- REM 设置结束日期
- set end=2019-01-15
- set /a sy=%start:~,4%,sm=1%start:~5,2%%%100,sd=1%start:~8,2%%%100,ey=%end:~,4%,em=1%end:~5,2%%%100,ed=1%end:~8,2%%%100,a=31
- for %%a in (1 3 5 7 8 10 12 4 6 9 11) do (
- if %%a equ 4 set /a a-=1
- set /a _%%a=a
- )
- (for /l %%a in (%sy%,1,%ey%) do (
- set /a "_2=^!(%%a%%4)&^!(^!(%%a%%100))|^!(%%a%%400)+28"
- set /a a=1,b=12
- if "%%a" equ "%sy%" set /a a=sm
- if "%%a" equ "%ey%" set /a b=em
- for /l %%b in (!a!,1,!b!) do (
- set /a c=1,d=_%%b
- if "%%a%%b" equ "%sy%%sm%" set /a c=sd
- if "%%a%%b" equ "%ey%%em%" set /a d=ed
- for /l %%c in (!c!,1,!d!) do (
- for %%d in (%%b %%c) do set ".%%d=0%%d"&set ".%%d=!.%%d:~-2!"
- echo %%a-!.%%b!-!.%%c!
- )
- )
- ))>"%temp%\DateList.txt"
-
- type nul >"结果.txt"
- for /f %%a in ('type "%temp%\DateList.txt"') do (
- if exist "%%a*.txt" (
- type "%%a*.txt" >>"结果.txt"
- )
- )
复制代码
|