本帖最后由 batman 于 2011-6-6 16:08 编辑
老实人做老实事:- @echo off&setlocal enabledelayedexpansion
- echo,&set /p start=请输入开始日期(形如2000-03-21):
- echo,&set /p end=请输入结束日期(形如2000-03-21):
- cls&echo,&echo,&echo,&echo,&echo 程序正在运行中,请稍候。。。
- 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!
- )
- )
- ))>list.txt
- start list.txt
复制代码
|