i have wrote this batch file and the result is not good :
for /f "tokens=1" %%a in (.\list3.trc) do (
set NAME=%%a
echo %NAME%
pause)
the file list3.trc contain program names.
Why the echo %NAME% doesn't return all the program names ??
the execution result is :
FOR /F "tokens=1" %a in (.\list3.trc) do (set NAME=%a & echo &
pause)
(set NAME=dudley_editinv & echo & pause)
ECHO is on.
Press any key to continue . . .
(set NAME=dudley_inventaire & echo & pause)
ECHO is on.
Press any key to continue . . .
Please help me...
NOTA : I don't want to simply display the name but i want to make task
with this name.....
I know that the following file work fine :
for /f "tokens=1" %%a in (.\list3.trc) do echo %%a
for /f "tokens=1" %%a in (.\list3.trc) do (
set NAME=%%a
for /f "tokens=2 delims==" %%b in (
'set^|findstr/b /i "name="') do echo %%b
pause)
"Yannick Ambert" <yam...@sls.fr> wrote in message
news:3871d6f9...@news.cornut.fr...
: Hello,
:
Another way is
for /f "tokens=1" %%a in (.\list3.trc) do call :sub
goto :eof
:sub
set NAME=%%a
echo %NAME%
pause
goto :eof
Bennett Benson
for /f "tokens=1" %%a in (.\list3.trc) do call :sub1 %%a
goto end
:sub1
set NAME=%1
echo %%b
pause
goto :eof
:end
On Tue, 4 Jan 2000 13:29:02 -0500, "Walter Zackery"
<walter_...@my-Deja.com> wrote:
>
>NT processes a command line by expanding all environmental variables
>BEFORE executing the line. That means that if you set a variable and
>then try to echo that variable on the same command line, then the
>value that will be echoed is the value of the variable as it was on
>the previous command line. If the variable wasn't set, then you'll see
>the message that you're seeing: ECHO is on. One workaround for this is
>the following command line.
>
>for /f "tokens=1" %%a in (.\list3.trc) do (
>set NAME=%%a
>for /f "tokens=2 delims==" %%b in (
>'set^|findstr/b /i "name="') do echo %%b
>pause)
>
>
>