| | | >"%temp%/MyDate.vbs" echo strLastHours=DateAdd("h", -1, time) | | >>"%temp%/MyDate.vbs" echo strFmtDate=Right(Year(date()),4) ^& Right("0" ^& Month(date()),2) ^& Right("0" ^& Day(date()),2) ^& Right("0" ^& Hour(strLastHours),2) | | >>"%temp%/MyDate.vbs" echo WScript.Echo strFmtDate | | for /f %%a in ('cscript /nologo "%temp%/MyDate.vbs"') do (set ys=%%a)COPY |
(不能显示15的上一天14号的23点) | | | >"%temp%\MyDate.vbs" echo LastDate=date()-1 | | >>"%temp%\MyDate.vbs" echo FmtDate=right(year(LastDate),4) ^& right("0" ^& month(LastDate),2) ^& right("0" ^& day(LastDate),2) | | >>"%temp%\MyDate.vbs" echo wscript.echo FmtDate | | for /f %%a in ('cscript /nologo "%temp%\MyDate.vbs"') do ( | | set DstDate=%%a | | ) | | set /a h=%time:~0,2%-1 | | if %time:~0,2% gtr 10 (set ys=%date:~0,4%%date:~5,2%%date:~8,2%%h%) | | if %time:~0,2% lss 10 (set ys=%date:~0,4%%date:~5,2%%date:~8,2%0%h%) | | if %time:~0,2% equ 0 (set ys=%DstDate:~0,4%%DstDate:~4,2%%DstDate:~6,2%23)COPY |
(不能显示10点的上一个小时9点)
本脚本显示的是当前时间的前一天 2014031714
第一个脚本0-1点时间不能自动减去1天
第二个脚本10点不能自动跳到9点
大家最好能推荐一个支持被动的ftp工具,nat里面ftp服务器。用命令行客户端是不支持被动的, |