批处理,计算日期( 适用winxp win2003)

@echo off
Rem 天数, 删除N天前的文件数据
set N=16

Rem 获取N天前的日期
@echo off 
echo wscript.echo dateadd("d",-%N%,date) >%tmp%\tmp.vbs 
for /f "tokens=1,2,3* delims=-" %%i in ('cscript /nologo %tmp%\tmp.vbs') do ( 
set "yyyy=%%i"
set "mm=%%j"
set "dd=%%k"
) 
if %mm% LSS 10 set "mm=0%mm%" 
if %dd% LSS 10 set "dd=0%dd%" 
set oldyyyymmdd=%yyyy%%mm%%dd%
echo %oldyyyymmdd%
pause 

你可能感兴趣的:(F#,J#)