How to capture all console output from a TCMD session?

May 9, 2013
the LOG command is close to useless IMO. It only captures what I already know: the commands issued (which are already in the BTM file - so no actual information whatsoever captured).

What I need to know is... what happened?

And that's the part LOG can't manage to do whatsoever.

So... might there be a way to get LOG to be useful? Or what is the recommended "capture" technique?


Jul 6, 2008
How about using the TEE command with a pipe to the file of your choice, which could be your log file?

Output from a simple test:
Tue  Nov 24, 2015 12:09:40 [6072]
C:\JPSoft\TCMD17x64>*dir /a /k /m *.ini | tee test9.txt
11/06/2015  18:42  5,678  tcmd.ini
11/22/2015  13:21  5,342  tcmdOneTccTab.ini
11/30/2014  1:22  5,602  tcmdV17.ini
11/23/2015  10:02  396  updater.ini

Tue  Nov 24, 2015 12:09:54 [6072]
C:\JPSoft\TCMD17x64>type test9.txt
11/06/2015  18:42  5,678  tcmd.ini
11/22/2015  13:21  5,342  tcmdOneTccTab.ini
11/30/2014  1:22  5,602  tcmdV17.ini
11/23/2015  10:02  396  updater.ini

So if I want the command and the results in my LOG file, defined by %logfile, I could use:
Tue  Nov 24, 2015 12:09:54 [6072]
C:\JPSoft\TCMD17x64>*dir /a /k /m *.ini | tee /d /t %logfile
2015/11/24 12:17:52.587 11/06/2015  18:42  5,678  tcmd.ini
2015/11/24 12:17:52.587 11/22/2015  13:21  5,342  tcmdOneTccTab.ini
2015/11/24 12:17:52.587 11/30/2014  1:22  5,602  tcmdV17.ini
2015/11/24 12:17:52.587 11/23/2015  10:02  396  updater.ini
which will display the results of the dir command with date and time stamps to my monitor and also add it to my log file which would record the command, if logging is on, and the result.

Charles Dye

Super Moderator
Staff member
May 20, 2008
Albuquerque, NM
You can also save the contents of the console buffer to a text file with the Save button, under the "Home" menu item. Note that the console buffer has a finite length; you'll want to save it before it completely fills up and stuff starts scrolling off the top.
May 9, 2013
I went with redirecting each external to append a log file.

I can't use the save buffer due to this running automated & headless from a service.

I just think it's silly to have a logging function that can't log anything really. Not much of a logging function.

But thanks for the kind responses & ideas.


Staff member
May 14, 2008
There are several ways to log output. But if you want to log output of external apps, the only way to do that (other than redirection, which only gets the output if the app writes to STDOUT & STDERR) is to inject a dll into every process that TCC starts and to intercept the console I/O functions.

I actually did a test version a while back that did this, but there are some drawbacks:

1) TCMD / TCC output is much, much slower (like 5x slower).
2) Many (most?) antivirus & antimalware apps will flag TCC as a virus, and kill it.
3) Once we start injecting code into other apps, we get blamed for every bug in every app.
Similar threads
Thread starter Title Forum Replies Date
J Screen Capture (Console Mode) Support 5
samintz How to? Screen capture with color Support 13
C How to? Capture keystrokes? Support 1
vefatica Console not redrawn in BTM or with multiple commands Support 4
vefatica ShutdownPlugin not called when I X the console? (just curious) Support 4
vefatica Console popup windows don't work correctly Support 0
vefatica Cancelling selection in the console? Support 7
G Console exe up / down history Support 8
vefatica Console cursor height in Win 10 Support 3
vefatica BTM, elevated, console window caption? Support 4
vefatica TCEXIT not executed if I X the console Support 4
vefatica TYPE resets console tab settings Support 14
vefatica Undesired scrolling in Windows 10 enhanced console. Support 2
L WAD In console, tabs are rendered with non-uniform tab-stop spacing Support 16
P No linefeed on last line of console window Support 2 TCC v22 & the Windows 10 Console Support 5
C TCMD not hiding the console Support 1
jaltman tcmd 21.0.19 win10 16179 console window loses content Support 2
vefatica Console output slower that before Support 8
L Fixed console line length in Take Command 19? Support 3
P Color directories in Win10 build 10586 console Support 11
I Windows 10 console does not allow alt-F4 alias to complete Support 1
M Console-Mode (*.exe) works in TCC, not in TCMD Support 2
vefatica ON CLOSE, GOTO, and X-ing the console Support 5
I Attach console Support 3
C Screens of different size and hidden console Support 8
G Bug? TCC 16.03.55 Console Palette Support 4
C TCMD: Problem attaching console Support 4
vefatica OT: Windows console history? Support 7
D Console window titles / tab caption Support 4
vefatica ON <closing the console> Support 5
vefatica Complete console caption as TCMD's caption? Support 1
Mordachai How to get a TC interface instead of a console for .btm, .bat, ? Support 10
fpefpe How to? Fonts / Size in console window Support 5
A How to? Is it possible to freeze one side of the console? Support 19
Stefano Piccardi How to? keep console from scrolling Support 6
noahcoad @ruby closes console Support 2
noahcoad Start new console without focus Support 3
vefatica TCSH crashes only when in a TCC console Support 2
vefatica Very strange console font corruption Support 3
p.f.moore Is the TakeCommandIPC interface available from other console programs? Support 3
J How to? 'tab' characters in the console and clipboard 'copy' Support 1
vefatica Console not closing ... problem gone Support 1
T Wrong prompt in Windows command console Support 3
vefatica Console not closing Support 1
E Redirect output from "start"-ed console Support 5
vefatica Hidden console doesn't close Support 34
J Console editor for TCC12 Support 10
J TC12 Win7 console, running gawk scripts Support 0
lassevk exit(1) in a python script exits console, by design or bug? Support 1

Similar threads