![我正在尝试在批处理文件中减去](https://linux22.com/image/1515912/%E6%88%91%E6%AD%A3%E5%9C%A8%E5%B0%9D%E8%AF%95%E5%9C%A8%E6%89%B9%E5%A4%84%E7%90%86%E6%96%87%E4%BB%B6%E4%B8%AD%E5%87%8F%E5%8E%BB.png)
这是我的代码搞乱的部分。
@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
没关系,不过我玩了一会儿之后就修好了