Bat file set command
I have the following
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%
The first echo works开发者_如何学Go correct, next ones don't return anything. Could you tell me what's wrong? Thank you
You should not have spaces on either side of the =
in your set
statements.
Use:
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%
which produces what you want:
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
精彩评论