我在 VS 2010 中构建 TFS 之后运行这个 .bat 文件。但它抛出错误说“文件名目录名称或卷标语法不正确”
我的批处理文件包含以下内容:
REM "*******START :Modify the following sections*******"
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86_amd64
set ProjectPath=C:\Builds\1\xxxx\xxx\Sources
Set PATH=%PATH%;%Windir%\Microsoft.NET\Framework\v4.0
REM "------Move to the Project Folder------"
cd /c %ProjectPath%
cd C:\Builds\1\xxx\xxxx\TestResults
REM "------Find the latest Test Result file------"
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in ('dir/b/a-d/o-d "C:\Builds\1\xxx\xxxx\TestResults\*.trx"') do (
set latesttrxfile=%%a & goto :done
)
:done
echo %latesttrxfile%
REM "------Move to test results folder------"
cd C:\Builds\1\xxx\xxxx\TestResults
REM "------Convert trx to html------"
trx2html "C:\Builds\1\xxx\xxxx\TestResults\%latesttrxfile%"
REM "------Find the latest Test Result html file------"
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in ('dir/b/a-d/o-d "C:\Builds\1\xxx\xxx\TestResults\*.htm"') do (
set latesthtml=%%a & goto :done
)
:done
echo %latesthtml%
REM "------Send Email------"
sendEmail.exe -s xxx.xxx.xxx.com -f yyyy@xxx.com -t yyyy@xxx.com -u Test Report attached -a "C:\Builds\1\xxx\xxx\TestResults\%latesthtml%" -m TestReportAttached
Pause