|Introduction||Directory Tree List|
|tcc Pet Tricks||Configuring|
|Recursive Directory Processing||Multitasking|
|Directory Diff||Console Colours|
|Recursively Running a Utility on a Directory Tree||Links|
|Copying just selected Dirs from one tree to Another|
A replacement for Windows W2K, XP, W2003, Vista, W2008, W7-32, W7-64, W8-32, W8-64, W2012, W10-32 and W10-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. A stripped down version of tcc.exe is available free. Since it is missing the fileage function, I found it unusable. The familiar 4nt.exe is still there, but renamed to tcc.exe. The current version is 22.0.41 Last revised/verified: 2018-04-22.
TCC (Take Command Console) is the non-GUI interface.
It comes in two versions:
|Take Command Versions|
|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  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 sync 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.
If you want a list a tree of directory names without any embedded files or statistics, look in file C:\Users\user\AppData\Local\JPSoft\jpstree.idx where Take Command maintains a list of most directories on most drives.
You should also run "X:\Program Files\JPSoft\TCMD21\tccbatch.btm" with run-as-administrator.
Use the OPTION command to set the following parameters:
|error||bright red||#ff0000||bright white||#ffffff|
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.
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. See Hints on how to coordinate tasks.
Controlling the colours of the foreground and background colours in Windows/Take Command console is baffling. Part of the problem is a legacy that goes back to DOS/4DOS days and hardware capable of only monochrome or 16 colours. I get the console colours behaving and as I want and they suddenly change all by themselves to unsuitable values. It is so frustrating I could spit. To start, let us look at eight places you can exert influence:
Try fooling around with all eight places before you give up.
Given that the whole console colour mechanism is broken, here is a strategy to make it work reasonably stably.
In future, the format of the *.lnk file should be changed so that you can configure regular, error and popup forground and background colours with 24-bit colours, completely independent from any other *.lnk file, without being limited to a 16-colour palette. Nothing you can do to one *.lnk file should screw up the colours in another. The colours should not change unless you explicitly change them. Perhaps you should be allowed a layer of indirection, e.g. specify colours to be the same as some other *.lnk. Then you could change the colour scheme of many *.lnk files by changing one master *.lnk.
For now, you can set the colours to anything you want, but they will stick for only one session. What a flipping mess! As my math professor Melzak used to say Somebody should be shot.
To generate a *.BTM file, use the windows-1252 encoding. Then run the following windows-1252.btm to see what various char numbers generate. Even though *.BTM files are displayed in encoding, writing them directly in IBM850 encoding does not work.
This page is posted
Optional Replicator mirror
Please read the feedback from other visitors, or send your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.
Your face IP:[126.96.36.199]
You are visitor number|