我有以下
echo off
set installType = /t
set msBuild=c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
set adminBuild = %msBuild% "d:\Projects\Test\Test.csproj" /T:Package /P:PackageLocation="d:\Projects\MSBuild\Package\Test.zip"
set adminDeploy = d:\Projects\MSBuild\Package\Test.deploy.cmd %installType%
echo %msBuild%
echo %adminBuild%
echo %adminDeploy%
第一个回声是正确的,下一回不会返回任何东西。你能告诉我什么是错的吗? 谢谢
答案 0 :(得分:1)
=
语句中set
的任何一侧都不应有空格。
使用:
echo off
set installType = /t
set msBuild=c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
set adminBuild=%msBuild% "d:\Projects\Test\Test.csproj"...
set adminDeploy=d:\Projects\MSBuild\Package\Test.deploy.cmd %installType%
echo %msBuild%
echo %adminBuild%
echo %adminDeploy%
产生你想要的东西:
c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "d:\Projects\Test\Test.csproj"...
d:\Projects\MSBuild\Package\Test.deploy.cmd