Take Command : Java Glossary
home T words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish 2008-03-03 by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
Take Command Take Command
A replacement for Windows W2K/XP/W2K3/Vista command.com/cmd.exe that adds many extra features to BAT file processing. It includes 4NT for console batch files and a GUI equivalent. Even the familiar 4NT.exe is still there, 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. 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 4NT console batch component.
Redirection COMSPEC
File Timestamps Configuring
4NT Pet Tricks Links
Caveats

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 4NT installed you can type:

javac.exe *.java >& err.log
Both STDOUT and STDERR stuff will go to the err.log file. You might write something like this:
javac.exe *.java |& more
This pipes both the STDOUT and STDERR stuff to the more utility which will display it an page at a time. For fine control you can write something like this:
javac.exe *.java 1>err1.log 2>err2.log
This sends STDOUT stuff to the err1.log file, and STDERR stuff to the err2.log file. If you want the STDERR and STDOUT stuff to go both to a file and to the console you could write:
javac.exe *.java |& tee err.log |& more
When using tee with a pipe under 4NT, 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 4NT. 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 the [] around parms and lack of () around the if expression.
if %@FILEAGE[myfile.java] GT %@FILEAGE[myfile.exe] call recompile myfile

4NT Pet Tricks

Here are some of the sorts of tricks I use with 4NT.
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.

Caveats

COMSPEC

You can set up 4NT as your default command processor my setting the SET environment COMSPEC parameter to:
"F:\Program Files\JPSoft\4NT8\4NT.EXE" /E:2500 /C

Configuring

Use the OPTION command to set the following parameters: Each window controlled by 4NT can override the OPTION properties independently. In the upper left corner of each window, click properties:

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.18] The information on this page is for non-military use only.
You are visitor number 11. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/takecommand.html J:\mindprod\jgloss\takecommand.html