A replacement for Windows W2K/XP/W2K3/Vista/W7
command.com/cmd.exe that adds many extra features to
BAT file processing. It includes tcc (née 4NT) for console batch files
and a GUI equivalent. tcc used to be sold separately. Even the familiar 4nt.exe
is still there, but renamed to tcc.exe. You can make a
copy as 4nt.exe so you don’t have to change
anything but the name of the install directory. You can upgrade from 4NT for the
same price as an upgrade from an earlier version of Take Command. The current
version is 11.00.33 Last revised/verified: 2009-11-10.
It comes in three versions:
| Take Command Versions |
| Version |
Cost |
Notes |
| TCC/LE |
free |
console tcc version only |
| Take Command/LE |
|
console + GUI, no debugger |
| Take Command |
|
full version |
I have only limited experience with the GUI component, (which does not apear to
do much), though I bought a copy of Take Command on 2008-03-04
so everything following is about the tcc console batch component.
Redirection
It is initially of interest to Java programmers because it lets you redirect
both STDOUT and STDERR to files, pipes or tees. The feature allows you to
redirect the output of javac.exe,
i.e. the error messages, which appear on STDERR, to a file, or to both a file
and the console. Why is that important? Capturing the error messages from javac.exe
can be a hassle since they scroll off the screen faster than you can read them.
Ordinary > redirection won’t capture them to
a file because they are going to STDERR, not STDOUT.
Once you have tcc installed you can redirect output:
or pipe output to another utility:
javac.exe *.java | more
javac.exe *.java |& more
or pipe with a tee to both redirect to a file and pipe:
When using tee with a pipe under tcc, the programs on
the two ends of the pipe run simultaneously, not sequentially as in 4DOS. This
means more starts producing output right away. It does
not need to wait until the compile finishes.
Programs don’t have to be on the path to start them with tcc. They just
need an Registry App Paths entry so there is
no need to put a directory on the path unless it contains several programs. This
keeps your path short, simple and fast.
File Timestamps
You can play with timestamps (improperly called ages)
like this:
if %@FILEAGE[myfile.java] GT %@FILEAGE[myfile.exe] call recompile myfile
tcc Pet Tricks
Here are some of the sorts of tricks I use with tcc.
Here an example of recursively descending a directory tree and processing each
directory it finds.
Here is an example that compares two directories, looking for mismatches,
missing, older, newer, or extra files.
Here is an example of an iteration over all directories in a tree, and within
that over each file. This is a useful script to keep to trees in synch by
deleting files in the destination that no longer exist in the source.
Caveats
- The biggest problem with tcc is you may not distribute it to you customers in
any way. If they want to run your *.bat files they must
buy and install tcc for themselves. There is no such thing an a tcc runtime.
- There is a version of tcc for Windows W95/W98/Me called 4DOS.
- I have encountered only one bug: CDD /S DE will not
work unless a C: drive exists. You can work around
that by providing it with a dummy one with SUBST C: D:\
- I think this is now fixed but in version 4.01,
wildcards on long file names will be performed on both long and short filenames,
so often you get two matches on the same file! The result in you often notice
tcc running a utility twice when you use wildcards.
- You can install it as your official command processor, replacing cmd.exe
with by setting the COMSPEC environment variable to:
- With Vista, the registration key can mysteriously disappear. Use the inikey
version to keep it in a file instead of the flaky registry.
- With Vista, the defender will keep asking you for permission to run tcc. Change
the short cut you use to invoke tcc in the for all users option to tell
it not to run as administrator.
COMSPEC
You can set up tcc as your default command processor by setting the SET
environment COMSPEC parameter to:
"F:\Program Files\JPSoft\TCMD11\tcc.exe" /E:2500 /C
Configuring
Use the OPTION command to set the following parameters:
- register, where you put your registration key.
- command line: extended directory search: 2. This
makes CDD a very useful command to jump to a directory on any drive just by
typing a few letters of its name. It creates an auxiliary list of all
directories in C:\Users\user\AppData\Local\JPSoft\jpstree.idx
or in C:\users\user\AppData\Local\JPSoft\jpstree.idx
in Vista/W7.
- advanced ntsc descriptions on
- for Windows : colours try:
| use |
foreground |
background |
| output |
black |
#000000 |
bright cyan |
#96ffff |
| input |
blue |
#0000ff |
bright cyan |
#96ffff |
| error |
bright red |
#ff0000 |
bright white |
#ffffff |
Your C:\Users\user\AppData\Local\JPSoft\TCMD.INI
file might look like this:
Each window controlled by tcc can override the OPTION properties independently.
In the upper left corner of each window, click properties:
- shortcut : start in : your usual working directory.
- 14 point font
- screen buffer: 100 × 5000
- Window size: 100 × 40
- Edit options: insert mode and quickedit mode
- Screen background: 200-255-255 : pale cyan. You can also configure the popup
colour here.
Run tccbatch.btm to associate .bat,
.btm and/or .cmd with
TakeCommand. This association can be wrecked by a paranoid virus checker.
You can configure the size of the CDD window by dragging it to the size you want
with the mouse. This is a bit of a surprise since 4DOS/tcc/TakeCommand has been
keyboard driven since the DOS days.