The filename directory name or volume label syntax is incorrect
batch-file
Solution
I found that the issue was that my batch file was Unicode (default for a text file in VS 2010, it seems).
File > Advanced Save Options and change to Western fixed the problem.
Problem
I am running this .bat file after the TFS build in VS 2010. But it is throwing an error says "The filename 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/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 ```