@EXECSTR clobbers @ECHO ON

May 20, 2008
12,173
133
Syracuse, NY, USA
I'm accustomed to seeing all that my logon script does because it starts with @ECHO ON. I don't any more. I don't restart often so I can't say how new this behavior is, but it is new. I have whittled it down to the following test BTM.
Code:
@echo on
iff "%@execstr[netstat -ano]" == "" then
    echo foo
endiff
echo 1
echo 2

Here's its output.
Code:
iff "%@execstr[netstat -ano]" == "" then
foo
1
2

No further commands are echoed! Missing are "echo foo", "echo 1", and "echo 2".

Compare it to this (with @EXECSTR removed).
Code:
@echo on
iff 1 == 1 then
    echo foo
endiff
echo 1
echo 2

Output:
Code:
iff 1 == 1 then
echo foo
foo
echo 1
1
echo 2
2
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,689
106
Albuquerque, NM
prospero.unm.edu
Code:
C:\>type test.btm
@echo on
echo
echo "%@execstr[subst]"
echo

C:\>test.btm
echo
ECHO is ON
echo ""
""
ECHO is OFF

C:\>

Okay, that's odd. Tried temporarily renaming my TCSTART.BTM, but that didn't make any difference.
 
May 20, 2008
12,173
133
Syracuse, NY, USA
Here's another look at it, from CMD, comparing v24 and v25.

Code:
v:\> type ltest.btm
@echo on
iff "%@execstr[netstat -ano]" == "" then
        echo foo
endiff
echo 1
echo 2

v:\> d:\tc24\tcc.exe /c ltest.btm
iff "%@execstr[netstat -ano]" == "" then
echo foo
foo
echo 1
1
echo 2
2

v:\> d:\tc25\tcc.exe /c ltest.btm
iff "%@execstr[netstat -ano]" == "" then
foo
1
2
 

Similar threads