(追記) (追記ここまで)

Take Command : Java Glossary

home page go to the Java Glossary Home go to the Computer Buyer’s Glossary up jump to foot of page Google search web for more information on this topic Pinterest pin button
*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)
©1996-2017 2009年10月26日 Roedy Green of Canadian Mind Products
The CurrCon Java Applet displays prices on this web page converted with today’s exchange rates into your local international currency, e.g. Euros, US dollars, Canadian dollars, British Pounds, Indian Rupees… CurrCon requires an up-to-date browser and Java version 1.8, preferably 1.8.0_131. If you can’t see the prices in your local currency, Troubleshoot. Use Firefox for best results.

Take Command Take Command
menu

Introduction

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
Take Command Versions
Version Cost Notes
TCC/LE free console tcc version only
Take Command 100ドル.00 USD 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.

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:

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.

File Timestamps

You can play with timestamps (improperly called ages) like this:
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

tcc Pet Tricks

Here are some of the sorts of tricks I use with tcc.

[フレーム]

To calculate, add, subtract, multiply, divide use the @EVAL function.

Recursive Directory Processing

Here an example of recursively descending a directory tree and processing each directory it finds.

[フレーム]

Directory Diff

This script compares two directories to detect missing, older, newer, or extra files.

[フレーム]

Orphan Deleter

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.

[フレーム]

Recursively Running a Utility on a Directory Tree

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.

[フレーム]

Copying just selected Dirs from one tree to Another

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.

[フレーム]

Dir Tree List

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.

Caveats

  • The syntax is quite warty, with ugly elements borrowed from Microsoft DOS (Disk Operating System) and Windows command languages and FØRTRAN. The syntax is quite irregular and ad hoc. Like Topsy, it just growed. I hope some day they repackage the functionality in a cleaner language that looks like Java or is Java where you can compile your scripts for compactness and speed.
  • copy /u will replace older files and add new ones. copy /c will just replace older files.
  • Colour control of the console is broken. See below.
  • 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 and Me called 4DOS.
  • I have encountered only one bug in CDD (Change Disk and Directory) . 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:
"X:\Program Files\JPSoft\TCMD21\tcc.exe" /E:2500 /C

You should also run "X:\Program Files\JPSoft\TCMD21\tccbatch.btm" with run-as-administrator.

Configuring

There are bugs in the install program. To bypass them, uninstall the old version before installing the new version. Alternatively, sometimes you can fix a failed install by running the repair option.

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:\jpstree.idx, or possibly is the LOCALAPPDATA directory, C:\Users\user\AppData\Local\JPSoft\jpstree.idx or even the X:\Program Files\JPSoft\TCMD21\ directory. It is just a text file, which can be used to compose a list of directories to backup or directories to erase. You will probably want to unhide your C:\Users\user\AppData\ directory to make the list more complete.
  • NTSC (National Television System Committee aka Never The Same Colour)
  • for Windows : colours try:
    tcc colour scheme
    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.

Multitasking

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.

Console Colours

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:

  1. TCCOptionWindowsConsole Palette. You would think this would define the 16 custom colours you can use for foreground and background colours. It is not quite that simple.
  2. TCCOptionWindowsANSI (American National Standards Institute). You would think this would give you wider choice of colours.
  3. TCCOptionWindows foreground and background colours. These would be the defaults for all consoles.
  4. The Take Command Option menu.
  5. C:\Users\user\AppData\Local\JPSoft\TCMD.INI. The palette colours are encoded here as decimal numbers.
  6. When a console is running, you can right click the top barpropertiescolour. You see a palette of 16 colours. You can define each palette entry with a 24-bit colour, and assign palette colours to foreground or background. Then click apply. This looks very straightforward, but it simply does not work the way you would expect. If you select a colour not on the palette, it will revert to a colour on the palette the next time you open the window. Sometimes changing the palette has no effect. Sometimes it disturbs the colours of other consoles. Sometimes you get some quite different colour from the one you asked for. Sometimes you get a garish primary colour. I would have thought, when you modify a running console, you must be modifying a *.lnk file. I discovered Windows sometimes creates temporary *.lnk files corresponding to *.bat or *.btm files in "C:\Users\user\AppData\Roaming\Microsoft\Windows\Recent Items\". However, these *.lnk files are missing the menu items to control colours (though they may internally have colour-controlling fields). I thought perhaps Windows/Take Command might be hiding the colour information in the registry somewhere, but I could not find it.
  7. Similar to a running console, you can right click on a shortcut *.lnk file and configure its colours, so long as it is on the desktop, not on the task bar.
  8. You can embed commands like this is your *.bat and *.btm files.
    cls bright white on blue
    This gives you dynamic control of colours, but you are limited to a very small set of inappropriate colours.

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.

  1. Inside the TCC OPTION command, configure your palette with the 16 colours you want to use as foreground and background colours in your consoles. Never again change these.
  2. Catch consoles running and configure them. Just select from the palette. Do not define any new colours.

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.

Tips

  • You can time executions by enclosing the code in
    TIMER ON
    ...
    TIMER OFF
    It will display the elapsed time. You can also have multiple simultaneous timers.
  • Prior to version 17, echo and type used IBM437 encoding. In version 17 and later they use Windows-1252. The main difference is the decorative block and line drawing characters will no longer display. They have no equivalent in Windows-1252.
  • To compute an arithmetic expression, you must you the @EVAL function.
  • If TCC complains about your setting for TCStartPath, the problem may be that some other utility has the whole drive containing that directory locked.
  • Take Command now supports the Lua scripting language.

Generating *.BTM files

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.

[フレーム]

standard footer
CMP home jump to top

This page is posted
on the web at:

http://mindprod.com/jgloss/takecommand.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\takecommand.html
Canadian Mind Products
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.
Canadian Mind Products
IP:[65.110.21.43]
Your face IP:[40.74.122.252]
(追記) (追記ここまで)
Feedback You are visitor number
website statistics
[フレーム]

AltStyle によって変換されたページ (->オリジナル) /