set thisVer="2"
IF EXIST "C:\Program Files\Deployments\deploy.ver" (
FOR /F "tokens=* USEBACKQ" %%F IN (`type "C:\Program Files\Deployments\deploy.ver"`) DO (
type "C:\Program Files\Deployments\deploy.ver"
set build=%%F
)
echo "Build version: %build%"
echo "This version: %thisVer%"
IF "%build%"=="%thisVer%" (
echo "Same Versions"
exit /B 0
)
上面的代码生成以下输出...
"2"
"Build version: Files\Deployments\deploy.ver"
"This version: "2""
有人可以告诉我为什么%build%
不等于文件C:\ Program Files \ Deployments \ deploy.ver的内容吗?