%@EXECSTR[-X,...] generates CLS before execution?

x13

Nov 9, 2016
72
1
Netherlands
Hi all.

I'd like to know why %@EXECSTR generates a CLS before execution whenever it is invoked with a negative offset.

rem full result:
============================================
net statistics workstation
Workstation Statistics for \\this_pc

Statistics since 1 Apr 18.06

Bytes received 4805351517
Server Message Blocks (SMBs) received 345795
Bytes transmitted 9831079902
Server Message Blocks (SMBs) transmitted 345728
Read operations 110038
Write operations 18765
Raw reads denied 0
Raw writes denied 0

Network errors 0
Connections made 2
Reconnections made 0
Server disconnects 1

Sessions started 0
Hung sessions 4
Failed sessions 0
Failed operations 0
Use count 90
Failed use count 0

The command completed successfully.

============================================

rem works ok
echo %@execstr[net statistics workstation]
Workstation Statistics for \\this_pc

rem works ok
echo %@execstr[6,net statistics workstation]
Bytes received 4805351517

rem not ok!
echo %@execstr[-2,net statistics workstation]
***CLS***

The command completed successfully.

This is very annoying! And nothing can suppress this, not even >& NUL.
Any ideas?

x13
 
May 20, 2008
10,634
81
Syracuse, NY, USA
Post your TCSTART.BTM ?
Good one, Charles! CLS in TCSTART.BTM does it here, and only for negative n.

x13, if the point of the CLS is to get rid of the startup copyright message, you can do that with
Code:
Copyright=No
in the [4NT] section of TCMD.INI.
 

rconn

Administrator
Staff member
May 14, 2008
11,926
133
@EXECSTR will sometimes invoke TCSTART, and sometimes it won't.

If you have a positive offset, @EXECSTR will execute something like this:

(net statistics workstation) >! tempfile

and then read the designated line from the temporary file.

If you have a positive offset, @EXECSTR will execute this:

((net statistics workstation) | tail /n nn) >! tempfile

In the second example, TCC has to invoke another TCC to handle the pipe. The second TCC will run TCSTART and execute your CLS.
 

x13

Nov 9, 2016
72
1
Netherlands
I'm very sorry!

There was in fact a CLS in my TCSTART...

But I still don't get why it would only be executed when first %@EXECSTR parameter would be negative.

Anyway, I removed the culprit and this behaviour has stopped.

Thanks!!
I never would have thought to look in TCSTART.

x13
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,223
78
Albuquerque, NM
prospero.unm.edu
My TCSTART generally looks something like this:
Code:
@echo off
prompt $P$g
alias /r "%@path[%_cmdspec]aliases.txt"
setdos /i-zip /i-unzip

if %_transient == 1 .or. %_pipe == 1 quit

if plugin fortune if exist "%@path[%_cmdspec]\plugins\quotes.txt" set fortune="%@path[%_cmdspec]plugins\quotes.txt"
cls
cal /3 /h
ver /r
echo.
The first part, before the central IF, is executed by all shells. The second part is only for interactive shells.
 
Thread starter Similar threads Forum Replies Date
nickles Support 16