Weird Problem with echo command
Posted: 12 Apr 2011 05:23
Hallo all,
I have a rather simple question :
this works :
@echo on
for /f "delims=" %%g in ('findstr /I /R /C:"^ *.testdata" %file%') do set var=%%g
Output : ... set var=2: <testdata file="someFile.txt"/>
But when I try to do this :
@echo off
for /f "delims=" %%g in ('findstr /I /R /C:"^ *.testdata" %file%') do set var=%%g
echo. %var%
I get this output :
D:\Tools\eclipse\Workspace\testHtml>set var= <testdata file="someFile.txt"/>
The syntax of the command is incorrect.
D:\Tools\eclipse\Workspace\testHtml>echo. <testdata file="someFile.txt"/>
If I remove the echo then the error message dissapears. Any ideas?
Regards
Stefanos
I have a rather simple question :
this works :
@echo on
for /f "delims=" %%g in ('findstr /I /R /C:"^ *.testdata" %file%') do set var=%%g
Output : ... set var=2: <testdata file="someFile.txt"/>
But when I try to do this :
@echo off
for /f "delims=" %%g in ('findstr /I /R /C:"^ *.testdata" %file%') do set var=%%g
echo. %var%
I get this output :
D:\Tools\eclipse\Workspace\testHtml>set var= <testdata file="someFile.txt"/>
The syntax of the command is incorrect.
D:\Tools\eclipse\Workspace\testHtml>echo. <testdata file="someFile.txt"/>
If I remove the echo then the error message dissapears. Any ideas?
Regards
Stefanos