Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

tcc /c {cmd} - how to get the value of cmd in TCEXIT

Feb
64
1
i would like to tweak my TCEXIT.BTM so that it checks the exist code (done) and if we had a problem, does a PAUSE (so that I have a chance to see what was going in a cmd session that whatever link may have fired).

Now, is it possible when a session was started with /c {myCmd} to execute a command find out what that command was?
 
Maybe %CMDLINE or %@HISTORY[1] will help.

Code:
v:\> %comspec /c echo blah!
blah!

v:\> echo %cmdline
D:\tc31\TCC.EXE /c echo blah!

v:\> %comspec /c echo blah!
blah!

v:\> echo %@history[1]
D:\tc31\TCC.EXE /c echo blah!
 
I probably misunderstood. You want the transient (/c) TCC's TCEXIT.BTM to know what the command was ... right? It's clumsy, but you could put the command into an environment variable that would be inherited by the transient TCC and thus known to its TCEXIT.BTM.

Code:
set transient_cmd=whatever
%comspec /c %transient_cmd
 
does a PAUSE
Very, very, VERY bad idea. The moment your background script permanently blocks on some error message you get your system filled with dead sessions to complete denial of service.
Use logging instead. TCC has all the facility for that.
 

Similar threads

Back
Top