我正在尝试在批处理文件中减去

我正在尝试在批处理文件中减去

这是我的代码搞乱的部分。

@echo off
set /p year=

:start   
echo Waiting For The Year To Equal %year%
set /a left=%year%-%date:~6,4%
echo %left% Years Left
timeout /nobreak /t 1 >nul
if %date:~6,4%==%year% goto :01
goto :start

我无法让“set /a left=%year%-%date:~6,4%”为“%left%”赋值,这是我得到的结果:

Waiting For The Year To Equal 2018
Missing operand.
 Years Left

点击此处查看上述错误

请帮我!!!!

答案1

:start
cls
echo Waiting For The Year To Equal %year%
set dateyear=%date:~10,4%
set /a left=%year%-%dateyear%
echo %left% Years Left
timeout /nobreak /t 1 >nul
if %date:~6,4%==%year% goto :01
goto :start

没关系,不过我玩了一会儿之后就修好了

相关内容