本帖最后由 hanyeguxing 于 2011-8-9 10:13 编辑
- @echo off&set/a Y=%date:~0,4%,M=1%date:~5,2%%%-101,D=1%date:~8,2%%%100
- for /l %%a in (1,1,%M%) do set/a "D+=30+(%%a-%%a/8)%%2+!(%%a-2)*(!(Y%%4)&!(!(Y%%100))|!(Y%%400)-2)"
- set/a T=(Y-1)*365+Y/4-Y/100+Y/400+1,D+=T-1,M=D/7-T/7+1,"K=!(D%%7)*7+D%%7"
- for /f "tokens=%K%" %%a in ("Mon Tue Wed Thu Fri Sat Sun") do set K=%Y%_%M%_%%a
- md "%K%\" 2>nul
- copy "c:\*.csv" "%K%\"
复制代码
- @echo off&set/a Y=%date:~0,4%,M=1%date:~5,2%%%-101,K=(Y-1)*365+Y/4-Y/100+Y/400+1,"D=K-1+(M+1)/2+!(M-8)+!(M-10)+30*M+1%date:~8,2%%%100+!!(M/2)*(!(Y%%4)&!(!(Y%%100))|!(Y%%400)-2)",M=D/7-K/7+1,"K=!(D%%7)*7+D%%7"
- for /f "tokens=%K%" %%a in ("Mon Tue Wed Thu Fri Sat Sun") do set K=%Y%_%M%_%%a
- md "%K%\" 2>nul
- copy "c:\*.csv" "%K%\"
复制代码 要求%date%为标准格式,星期语言为任意 |