A replacement for Windows W2K/XP/W2003/Vista/W2008/W7-32/W7-64 command.com/cmd.exe that adds many extra features to BAT (Batch) file processing. It includes tcc.exe (née 4NT) for console batch files and a GUI (Graphic User Interface) equivalent. tcc.exe used to be sold separately. Even the familiar 4nt.exe is still there, but renamed to tcc.exe. The current version is 15.0.1.51 Last revised/verified: 2013-06-01.
It comes in two versions:
| Take Command Versions | ||
|---|---|---|
| Version | Cost | Notes |
| TCC/LE | free | console tcc version only |
| Take Command | full version | |
I have only limited experience with the GUI component, (which does not appear to do much), though I bought a copy of Take Command on 2008-03-04. Within that you can download the 32 or 64-bit version. Everything following is about the tcc console batch component. Take Command/LE has been discontinued.
Once you have tcc installed you can redirect output:
or pipe output to another utility:
rem pipe stdout to more utility javac.exe *.java | more rem pipe output of stdout and stderr to more utility 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.
REM if myfile.java is newer than myfile.exe, REM i.e. has a bigger timestamp, REM then recompile. REM note the the [] around parms and lack of () around the if expression. if %@FILEAGE[myfile.java] GT %@FILEAGE[myfile.exe] call recompile myfile
Here are some of the sorts of tricks I use with tcc.
To calculate, add, subtract, multiply, divide use the @EVAL function.
Here an example of recursively descending a directory tree and processing each directory it finds.
This script compares two directories to detect 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.
Here is the bloutall.btm script I use frequently. It runs the blout.exe utility on every file in the current directory, or optionally on every file in the directory tree. It only runs it on files with an extension that implies than contain readable text. blout.exe gets rid of excess blank lines and normalises line ending separators. I could also have implemented it with the simpler GLOBAL command.
Often you don’t want to process a whole directory true, just do the same thing to some or most of the directories in it. Here is an example where I provide a list of dirs I want to copy to the corresponding spot in another tree.
Look in all five places before you give up.
| use | foreground | background | ||
|---|---|---|---|---|
| output | black | #000000 | bright cyan | #96ffff |
| input | blue | #0000ff | bright cyan | #96ffff |
| error | bright red | #ff0000 | bright white | #ffffff |
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 (Disk Operating System) days.
Especially if have multiple CPU (Central Processing Unit) cores, you can speed things up by dividing your work between several *.btm files and running the simultaneously. You then need to launch them, wait for them to finish, and keep them from interfering with each other. Tools include: START, DETACH, _DETACHPD, %@isproc[], START /AFFINITY, Event utils plug-in (put the dlls in the X:\Program Files\JPSoft\TCMD13x64\PLUGINS directory.) See Hints on how to coordinate tasks.
|
|
available on the web at: |
http://mindprod.com/jgloss/takecommand.html |
optional Replicator mirror
|
J:\mindprod\jgloss\takecommand.html | |
![]() |
Please email your
feedback for publication,
letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear
wording, broken/redirected link reports, suggestions to improve this page or comments to
Roedy Green :
| |
| Blog | Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[50.16.166.175] |
|
| Feedback | You are visitor number 11. | |