NDOS ? by Chris Bieda Why You Should Delete command.com In the Beginning Sooner or later, every victim of the MS-DOS and PC-DOS operating systems comes to learn that there are three essential files that compose the core of the systems. (In MS-DOS, these are msdos.sys, io.sys and command.com; in PC-DOS, ibmdos.com, ibmbio.com and command.com.) This knowledge usually is acquired shortly after the user deletes command.com because it doesn't appear to do anything useful, and besides, it's taking up disk space. (This is also the point at which many users learn the expressions "bootable disk" and "boot floppy.") The undaunted few proceed beyond this sobering experience to learn what command.com actually does: it supplies the interface, a command line, to DOS, as well as provides certain fundamental utilities, like copy and rename, and delete and "dir." (The fact that command.com accepts what you type to the command prompt and decides how to handle it, either by processing the command itself, or loading another program to do so, is why it is referred to as "the," or more properly, if rarely, "a" command processor or command interpreter.) This ascension to the intermediate heights of power userdom is often followed by the shocking revelation that command.com is, in fact, an optional interface, at least insofar as you need not use command.com if you have another command processor available! (Just as an aside, if there is reading this an OS/2 user who is not familiar with DOS, your cmd.exe serves the same purpose as DOS's command.com, and it is just as optional!) Command Processor Options Besides DOS's command.com, there are two other options for command processors that I know of (I would be glad to learn of others): the JP Software company's 4DOS, a shareware program, and the Symantec Corporation's NDOS. In fact, these two programs are extremely similar, largely because NDOS is a licensed OEM version of an earlier release of 4DOS! NDOS is supplied with version 6.xx of The Norton Utilities, for many the indispensable set of DOS utilities, and corresponds roughly to version 3.02 of 4DOS, which is currently at version 4.01d. Since many of us own The Norton Utilities, and many more should, I will describe cool features of NDOS throughout this series. You should note, however, that virtually everything I describe works precisely the same way in the newer 4DOS , and if you don't own the Norton package, you can attain the same level of functionality by using 4DOS (which is available from our BBS service, as well as our public domain and shareware library service, Public Brand Software). By the end of my tour, I suspect that quite a few of you will delete command.com one last time, because these optional processors are great! Compatibility Considerations Probably the coolest feature of NDOS is that it is fabulously compatible. In fact, since booting to it for the first time over a year ago, I haven't found a single application or utility, or DOS routine, that gags or runs differently. This is no small feat, since there are literally dozens of books out there with titles like Undocumented DOS or Secrets of the Command Line Bill Gates Doesn't Want You To Know. DOS, like any complex operation (it is a system, after all), is full of bugs, leftover code (with leftover unintentional results) and back and trapdoors, as well as undocumented or unsupported features. To successfully support Windows 3.x, DESQview, and some of the worst-written TSR's (terminate and stay resident, or "pop up," programs) ever, which were written for command.com exclusively, NDOS must mimic the basic operations of command.com almost perfectly. Based on my experience, it does. Installation A lesson many support personnel learn, often by painful trial and error, is to get command.com tucked safely away in some place that del-happy tyros won't easily find it (this is called "making your life easier"). The traditional remedy has been to copy command.com to a subdirectory, say the c:\dos subdirectory, and to add the following line to the config.sys file in the root directory: shell=c:\dos\command.com c:\dos /p which instructs DOS to look for command.com in the specified subdirectory at bootup, to look for a copy of command.com in c:\dos when (if) it needs to load another, and (the "/p" part) to leave DOS running that particular processor ( c:\dos\command.com ) when the bootup procedure is done. (It will also cause c:\autoexec.bat to be run, which is most often a good thing!) Once these modifications were made (and with a bootable floppy at the ready), c:\command.com was deleted, and the system rebooted to look for, and use, the command.com tucked away. This often solved the problem of del -zeal. (It remains recommended.) This same method is used to call NDOS instead of command.com, to wit: shell=c:\norton\ndos.com c:\norton /p So much for installation. Making It All Pretty For real DOS-jockeys, the command-line, and not some fancy menuing interface like Windows, GeoWorks or even XTree, is the only way to fly; it's certainly quicker, and "doing" the command-line marks you as a real pro. It's what separates the adults from, say, Macintosh users (just kidding folks). And for these people, the appearance of their beloved DOS "prompt" (the onscreen "message" displayed while DOS awaits your next command) is critical. It must be useful, perhaps fanciful, but certainly unique. Probably 95% of all DOS systems have a prompt that looks like "A" or "C" or "A:\" or "C:\". While these are useful (surely the latter pair more than the former), they are not fanciful, nor unique. command.com gives you a handful of prompt customization options, but NDOS supplies more, including perhaps the coolest prompt feature imaginable, the (jargon-alert!) "shell nesting level." Back up a moment. The "shell," as you might have gathered by now, is the context in which DOS software (applications and utilities) are run. It is established and maintained by the command processor (whether command.com or NDOS), and a single context (instance of the shell) is often all that a user, particularly one who works solely within single applications (like 1-2-3 or WordPerfect) requires. Many users, however, use and enjoy a feature supplied by many applications, commonly referred to as "shelling to DOS," or "opening a DOS shell." These functions give the appearance of temporarily exiting the application and returning to a point immediately before the application was loaded, when the user was staring at a DOS prompt. In fact, this is an illusion. Far from exiting the application, opening up a shell from within it temporarily suspends the processing of that application (disconnecting it, as it were, from the keyboard, display, disk drives, etc.), and opens up another application: the command processor. You see, whether you are using command.com, ndos. com or 4dos.com, you are already running a program (hence the ".com" for a command file), which is a command processor, or "shell." When you load 1-2-3 into that shell, you have now loaded two programs, the second beneath the first. When you use that second program's ability to "shell" to DOS, you open a third program (another shell), and while in that second shell, you may even open a fourth, such as a small utility program. God help you if that fourth program also allows shelling to DOS (if you're keeping count, number five), for if you do so, you may well get lost in your shells! This is hazardous in the extreme when using command.com-based shells, for t here is no simple way to tell if you are at the bottom of the "stack:" all the shells (command lines) look alike! (Several applications modify the prompt in the shells they spawn, to help clue you in, e.g., "Type "exit" to return to WordStar.;" many simply do not.) Should you shut your computer off (or should it lock up) while in a "nested" (number two or subsequent) shell, all your work in the applications resting below that was not saved before you went shelling will be lost. Scary stuff. NDOS enables a delightful prompt modification that can permanently save your bacon. Putting the lowercase letter z into your prompt string will imply the number of shells you have invoked by displaying the sequence number of the one you are currently in, starting with "0" (zero) for the first. So, for example: prompt Level z [$p$g] will return a prompt of "Level 0 [C:\]" when you are in the first (primary) shell, "Level 1 [C:\]" when in the second, and so on. As a result, when you are at any NDOS prompt, you know if there remain matters beneath the current shell that require your attention. (At Level 0, there is not; at other Levels, there are.) This is, of course, no help whatever when the computer locks up in a secondary or tertiary (or . . . ) shell, but when you are in control, you are never blind. To be perfectly honest, so much do I use shells, and so few of these shells provide customized prompts by themselves, that this one cool feature would warrant my use of NDOS over command.com. But there's more to NDOS than this, like faster batch file processing, interactive batch files, and a doskey facility that allows you to customize your environment to an amazing extent while saving RAM!