Invalid directory name or volume label syntax

I run this .bat file after building TFS in VS 2010. But it throws an error saying "The file name directory name or volume label syntax is incorrect"

My batch file contains the following:

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/ad/od "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/ad/od "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 
+4
source share
1 answer

I found that the problem was that my batch file was Unicode (the default for a text file in VS 2010 seems to be).

File> Advanced save options and a change in Western fixed the problem.

+3
source

All Articles