2010-07-15 165 views
0

我有以下.bat文件設置命令

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% 

第一回波的工作是正確的,未來那些不返回任何東西。你能告訴我什麼是錯的嗎? 謝謝

回答

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