Take Command -- the Windows Command Line on Steroids
RandallS - Tue, 2011-07-26 13:23
As I mentioned in my review of JP Software's freeware Take Command Console LE in February 2010, I used to use their old 4DOS program back in the days of DOS, Windows 3.1, and Windows 9x. 4DOS was the DOS Command Line on steroids: adding many features to the fairly primitive DOS command line. When I moved to Windows XP, I briefly flirted with 4NT (the 32-bit Windows version of 4DOS), but desided I really did not need it as I did not use the Windows command line enough top justify the purchase price, especially when Cygwin ported the Unix BASH shell to Windows. BASH runs circles around the Windows CMD shell -- even with the problems using it on a Windows box due to Windows using forward slashes as directory separators while Unix expects backslashes.
Last year when I updated to Windows 7, I discovered that JP Software was still around and providing a freeware version of their command processor (which I reviewed here: Take Command Console LE -- Freeware 4dos For Windows). I fell back in love with it. It had all the power I remembered from 4DOS -- and lots of new features 4DOS never dreamed of -- and none of the clunkiness of using the Unix Zshell (BASH on steroids) on a windows NTFS file system. A few days ago I visited the JP Software web site to look through their forums to see how others are using Take Command Console LE and I noticed that there was a new version (12.11) of their commercial version Take Command. I also noticed they were offering a free license to people who would review their software, so I decided to download a copy and take it for a spin.*
I am reviewing the 32 bit version of Take Command 12.11. There is a 64 bit version as well. Both will run on my 64 bit version of Windows 7, but I'm testing the 32 bit version as it should work on all modern versions of windows.
I downloaded the program and installed it. I made one change to the default options when I installed the program. I installed in in my applications directory in my user directory instead of in Program Files (x86). This allows me to use the program's directory to store batch files and other files associated with the program as I used to do with 4DOS and currently do with Take Command Console LE.
I fired up the program and instantly remembered why I had never bothered to try it before, instead of just bringing up a console window, it brings up a window with a Folder List, a List View of the files in the selected folder, and a tabbed command window. As I have a wonderful (and expensive) Explorer replacement, Directory Opus, I was not all that impressed. However, there's an option to turn the folder and list view off in the View menu. I did so. The tabbed command window took over the Take Command window.
I typed "dir" at the command prompt and got my first surprise. The Take Command window is fast. I've tried replacements for the Windows console menu before and have always been disappointed because the replacements are always slower -- often much slower -- than the standard console window (which isn't known for speed itself). Take Command is the first console window replacement I've ever seen that is considerably faster than the Microsoft standard. Like many other console replacements, Take Command allows multiple consoles in tabs, wider choice of fonts, etc. -- all without slowing the display to a crawl. Looking at JP Software web site, they claim that "It's fast - 20-200% faster at displaying output than the standard CMD command line." It is faster and not just with their own command processor, Cygwin Bash and Zshell, and Microsoft's Powershell displayed output much faster in Take Command's console windows than in the standard console.
After this discovery, I turned the folder and file list view back on in case I was missing something. I discovered that I could drag a directory or a file name into the tabbed command window and the full path to the file or directory in question would be added to the end of my current command line. That's a very useful feature that could save a lot of typing. On a lark I tried dragging file and directory names from Directory Opus 10 to the Take Command console window, this worked the same way. Even draging from Windows Explorer worked. The builtin folder and list view would be useful if Take Command is maximized, however.
For more general information on the Take Command environment and all you can do with it, take a look at the Introduction to Take Command tutorial on the JP Software web site.
Take Command's command/scripting language is a superset of what is available at the Windows CMD command line. What you already know is immediately useful. You don't have to learn Take Command's "174 internal commands, 280 internal functions, and 174 system variables" to start using Take Command. Every CMD command you already know just works. Although it's always worth looking at the Take Command help file as even standard CMD commands have been enhanced. For example:
Most internal commands which accept wild cards also allow size, date, time, exclusion, and description ranges to further define the files that you wish to work with. TCC will examine each file's properties to determine whether or not the file meets the range criteria that you have specified.
A size, date, time, or exclusion range specification begins with the switch character /, followed by a left square bracket [ and a character that specifies the range type: s for size range, d for date range, t for time range, or ! for exclusion range. The s, d, or t is followed by a start value, and an optional comma and end value. The range ends with a right square bracket ]. For example, to select files between 100 and 200 bytes long you could use the range /[s100,200].
Here's example, if I need a list of all the .txt files I created today or yesterday that are under 4K in size, I could use this DIR command:
dir /[d2011-7-25,2011-7-26] /[s0,4095] *.txt
This would give me a listing of all of those files in the current directory. Assuming these were the files I expected, I could then copy these files to a directory on my web server with this command:
copy /[d2011-7-19,2011-7-20] /[s0,4095] *.txt ftp://user:*@ftp.gridspace.net/backuptxt/
Yes, Take Command knows how to copy files to an ftp server. The above command would copy all the .txt files under 4096 bytes in file size and which were created today or yesterday to the backuptxt directory on my gridspace.net server, logging in as "user". Since I put a asterisk for my password, Take Command will ask me for user's password when it attempts to connect to the server.
My favorite 4DOS feature was aliases: the ability to create your own commands out of other commands, other programs, etc. This feature is still useful in Take Command today. In fact, some of my old 4DOS aliases work great, although a few needed some minor changes as Take Command uses different escape and command separator symbols. For example, I use a command alias "m" to display a list of subdirectories in the current directory that allows me to move the selection (a highlighted line) up and down the list with arrow keys ("point and shoot" style), when I press enter, it changes to the highlighted subdirectory. I created this command with the following alias command:
alias m="select /a:d cd (*.*)"
Select is a Take Command command which allows you do select files from a "point and shoot" display and pass them to a command for execution. The /a:d switch tells select to only display directories.
Here's another alias I use a lot:
alias prune="iff isdir %1 then&del /sxz %1&else&echo %1 not a directory&endiff"
Prune tests whether its argument is a directory. If it is a directory it deletes the directory and all subdirectories and files beneath it. If it isn't a directory, it gives an error message.
Take Command also features "keystroke aliases" and "directory aliases". Keystroke aliases are simply aliases that excute when a specific keystroke is pressed. I never used them much in 4DOS and doubt I will in Take Command. Directory aliases are another matter. For example, this alias points to my games directory:
I can run zdoom by typing "games:\doom2\zdoom.exe" instead of "c:\Users\randalls\apps\games\doom2\zdoom.exe. Directory aliases can be used with any of Take Command's 140+ commands, which makes them extremely useful.
Of course, the main use of a command interpreter is to write command scripts, which are still called batch files on Windows. The Windows CMD, like the DOS COMMAND.COM before it, does not have a very powerful scripting language with only primitive IF statements and GOTOs to control the script. Take Command greatly enhances batch files with DO loops, IF-THEN-ELSE statements, SWITCH statements, internal variables, functions, and much more. For a good overview, see the Scripting Language Basics tutorial page on the JP Software web site.
Take Command even allows event-based scripting via "triggers": a set of commands that allow you to monitor activities on your computer and to take an action based on changes occurring in the computer. For example, you can moniter folders and files with the FOLDERMONITOR command, taking action when a specific folder or file is created, modified, or deleted. Other trigger command allow monitoring the event log, network connections, processes, services, USB and FireWire connections, and the clipboard. For more information and sample code, see the Triggers (Event Monitoring) tutorial on the JP Software web site.
I've already mentioned that Take Command allows you to access files on ftp sites with standard commands. Take Command also adds a number of other Internet features to the Windows command line. In addition to standard FTP, Take command can access files via TFTP, FTPS, and SFTP. File (and web sites) can also be accessed via the standard web protocols: HTTP and HTTPS. You can also send email via the command line. Combing the ability to send email from the command line with the ability to monitor processes and you can easily write a one statement script which will send an email to you if a particular process dies.
Take Command adds many new commands and features to the Windows command line which allows one to write very powerful scripts. However, powerful scripts require testing and debugging before they can be used in production. Take Command makes this easier than it ever has been. It includes an IDE with a visual debugger designed for writing batch files with Take Command -- including the ability to step through batch files executing one statement at a time, the ability to set breakpoints, and to watch variable. If you do a lot of windows batch file scripting, the IDE alone is probably worth the price of Take Command. Rather than listen to me prattle on about this feature, watch this short video to see the IDE and debugger in action.
Is Take Command worth its $99.95 price? If you need to do complex Windows scripting in a familiar language, it is probably worth every penny. Take Command adds hundreds of features to the Windows command line -- including many that I haven't covered in this review (e.g. scripting with REXX, perl, python, etc. and user-written plugins with additional features). Combine these additions with Take Command's super fast command window, IDE and batch file debugger and you have a tool that should be on every system administrator or power user's desktop. If you've used the free Take Command Console LE, you are familiar with many of the extra commands Take Command offers, but you have no idea how much easier it is to write batch files with the IDE and batch file debugger included with the full version of Take Command. You can try Take Command for 30 days at no cost, so you really have nothing to lose -- and if you decide you like the expanded commands but don't need advanced commands like triggers, the fast mult-tabbed console replacement, and the IDE/Debugger, you can always switch to the free Take Command Console LE. However, after using the IDE/Debugger for a few days you may find downgrading harder than spending the C-note.
Operating System: Windows XP or later
Version Tested: 12.11
Web Site: http://jpsoft.com/
* This sentence was included to make the FTC happy. The feds seem to assume the average person is too stupid to know reviewers often get free copies of books, CDs, DVDs, and software they review.