Echo is off though everything is correct

May 16, 2011 at 13:28:21
Specs: Windows XP
Ok .. so here is my code in batch file:

@echo off

set /a n = 0

for /f "tokens=* delims= " %%a in (location.txt) do (
set /a n+=1
set vari!n!=%a

set count=1

call echo %%vari%count%%%


where location contains:


Logically, call echo %%vari%count%%%should result in a .. however it brings out Echo is Off

Can anyone please assist me?

See More: Echo is off though everything is correct

Report •

May 16, 2011 at 13:39:23
Logically, echo %vari%count%% should result in a
Logically, it should result in the contents of variable %vari%, the word count, and a single %. Win7's CMD confirms this.

set vari!n!=%a
I'm not sure exactly what this'll do, but it typically ends up with setting every element in your pseudo-array to the letter a.

Also, I don't see you enabling delayed expansion, but I'm assuming it is turned on.

How To Ask Questions The Smart Way

Report •
Related Solutions

Ask Question