PC/Computing DOS 5.0 coverage..
JULY 1991
OS/2 WAS SUPPOSED TO OBLITERATE IT. Windows was going to wipe it out. The
34AC promised to macerate it. Alternatives from Companies like Digital
Research, Hewlett-Packard, GeoWorks, and J.P. Software were going to put out
its lights.
But nearly a decade after its introduction, it's still going strong on 50
million systems worldwide. The truth is, in this world nothing is certain
but DOS and taxes.
Still, it's not exactly everybody's favorite. Most users rank DOS right up
there with gridlock, televangelists, mimes, flies, cholesterol, and midnight
subway rides through the Bronx.
Put it this way-if DOS were an airline, would you set foot on the plane?
Well, get ready for a big surprise: Microsoft's sizzling new DOS 5.0 has
fixed the problems that DOS users have been griping about for years. Think
DOS is too hard to use? Version 5.0 adds online help, a command stacker and
macro generator, and a point-and-click shell for managing files. Tired of
DOS's merciless tendency to wipe out important files with a single mistyped
keystroke? The new version's UNDELETE and UNFORMAT utilities can bring lost
files back to life. Frustrated by DOS'S pigheaded consumption of precious
RAM? DOS 5.0 is smart enough to load parts of itself into high and reserved
memory, freeing up loads of below-640K real estate.
About the only thing Microsoft didn't fix in this new DOS incarnation is the
eight-character-plus-extension limitation on filenames. Maybe next time.
Microsoft crows that this new version is "the most significant upgrade of the
MS-DOS operating system in its nine-year history." Most experts would
probably claim that Version 2.0/2.1 holds that title, since it introduced
support for hard disks, the hierarchical subdirectory structure, device
drivers and the CONFIG.SYS file, ANSI, batch file commands like ECHO and IF
and GOTO, the mini-assembler in DEBUG, file handles instead of CP/M-like file
control blocks, filters, redirection and piping, background PRINT processing,
user access to the environment, and nine-sector floppy disks. It also gave
users a handy little utility they didn't have before, called CLS. Imagine
life at the keyboard without aH this stuff.
10 Years After
Still, DOS 5.0 is definitely cause to celebrate. It's the 10th edition
(following 1.0, 1.1/1.25, 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, and 4.0) and was
released right before the 10th anniversary of the PC. And it probably will
become the new standard, the one you and everyone else you know should
finally upgrade to.
Before this new version, DOS was starting to look a little like the
doddering, overweight boxing champs we've seen in the past decade who have
held the title too long, have been staggered by a few too many blows, and
look too flabby even to get into the ring.
Microsoft knew it had to turn the tide. DOS was humming away under 20,000
commercial applications on 50 million desktops in the United States. It was
being distributed by more than 500 system vendors. It had been translated
into 13 languages worldwide. It ran on everything from palmtops to monster
networks.
A new version was on the development schedule, and the marketing-minded
Microsoft folks realized they were sitting on a gold mine. Few users had
switched to 4.0. Most were two generations back, with 3.3 or 3.1, and some
were still working with 2.l. Practically the whole customer base was primed
to upgrade, if Microsoft could turn out a new product that was both sexy and
bulletproof enough to become a standard. Or, as Microsoft's Rich Abel put
it, We wanted to make DOS 5.0 DOS."
To ensure that the new version wouldn't be just another release the market
would ignore, Microsoft asked users what they wanted. Lots of users. And to
ensure that those who had been burned with first-generation releases wouldn't
cool their heels until the bug-fix 5.1 version was out, Microsoft asked beta
testers to exercise it. Lots of testers. More than 4,000-a company record.
The DOS development team quickly realized it had three major challenges:
Free up memory
Improve "fit and finish"
Unify everything while adding features.
Memory Magic
Memory was the most daunting problem. As Microsoft's Brad Silverburg
remarked, "Below 640K is as costly as Tokyo real estate. Every single byte
has to justify itself. And DOS itself has to solve the problem. You can't
just throw more memory into the system. That would be like building condos
in Newark and expecting Manhattan suddenly to free up."
With DOS 5.0, Microsoft solved the below-640K RAM-cram problem four ways.
First, it rewrote the code to streamline the underlying guts, or kernel," by
optimizing it and removing functional redundancies introduced in Version 4.0.
Shrinking the kernel was no easy task, since Microsoft added features at the
same time. Furthermore, the company decided not to touch the bottom 16K DOS
data area because many "dirty" applications use this lowest part of RAM for
brute-force peeks and pokes. The goal was to
e entire DOS 4.0 feature set, and more, in the same space taken up by DOS
3.3. The new kernel is 5K smaller than the one in DOS 4.0, and only 5K
larger than the one in DOS 3.3.
Users of large hard disks will save an additional 6K because DOS 5.0 can
address volumes larger than 32MB without having to use SHARE.EXE (a clumsy
trick employed b DOS 4.0).
Tapping an Extra 64K
Second, Microsoft exploited a quirk of the Intel CPU that let it tack an
extra 64K onto the normal 1MB address space. (Quarterdeck swears it was the
one that discovered this "loophole" backin 1986 and the company used the
tecnique with Version 2.0 of its Desqview DOS extended in 1988 Microsoft
published its Extended Memory Specification-MS-which included this trick.
XMS also set e standard for DOS protected-mode access to extend memory, and
access to "reserved" memory above 640K but with the original 1MB.)
This limit of 1MB exists because the 8088 chip has only 20 address lines,
labeled AO through A19 (20=1,048,576, or 1MB). If you try to go any higher
on an 8088, you end up wrapping" around to the bottom of memory again.
However, starting with the 80286, Intel provided additional address lines.
Try to go higher than 1MB on an 80286 or any more recent CPU, and the
overflow is handled by the 21st address line, called A20. System software
can ignore the rollover to this A20 line or use it.
The effect was to get one more addressable 64K memory segment in real mode,
called HMA (High Memory Area). Not every application can take advantage of
this, since some get confused and will just try to wrap around. But
Microsoft engineers learned how to make DOS use this on any 80286, 80386, or
80486 with a minimum of 64K of extended memory and wrote an HMA driver and
A20 handler called HIMEM.SYS to do it. To get an extra precious 64K of
system RAM with DOS 5.0, just start off your CONFIG.SYS with
DEVICE=HIMEM.SYS
DOS=HIGH
DOS 5.0 normally takes up about 60K of RAM. But these two CONFIG.SYS
commands will load 45K of it into high memory, leaving a small 18K DOS
footprint in low conventional memory. This one simple step gives you an
additional 40K to 45K for your applications. If you use Windows 3.0 in
Enhanced mode, which lets you run multiple virtual DOS machines, each virtual
machine can save 40K to 45K.
Without the above CONFIG.SYS lines, conventional memory use looks like this:
MS-DOS 55.8K
COMMAND.COM 4.6K
Free memory 579.4K
Stuffing as much of the basic DOS information as possible into HMA changes
the map of conventional memory:
MS-DOS 12.5K
HIMEM.SYS 1.2K
COMMAND.COM 2.6K
Free memory 623.6K
(These figures were reported by the new DOS 5.0 MEM /CLASSIFY function.)
If you load DOS into HMA and use the BUFFERS= command, the disk buffers will
also be located in high memory. If you normally use 30 DOS buffers, putting
them in HMA will free up almost 16K more of low RAM.
With Version 3.3, Microsoft increased the maximum number of disk buffers from
99 to 10,000. DOS 5.0 reinstitutes the 99-buffer limit but automatically
stores these buffers in HMA if you use HIMEM and the DOS=HIGH command. In
previous versions you had to add a x switch to store the buffers in expanded
memory; this option is no longer available.
Exploiting Unused Memory
The third way Microsoft attacked the RAM-cram problem was to exploit unused
parts of reserved memory. Remember, the original design for the 1MB address
space dedicated the lower 640K of conventional memory to DOS and
applications, and reserved the upper 384K for use by video and ROMS. Most
systems use only a part of this reserved memory area. If you're using an
80386 or 80486, the DOS 5.0 EMM386 memory manager can take advantage of these
chunks of unused reserved memory, called UMBs (Upper Memory Blocks), by
wedging various DOS drivers and utilities in there.
To do this, follow the CONFIG.SYS lines just cited with
DEVICE=EMM386.EXE NOEMS
DOS=UMB
(The NOEMS argument parcels out the maximum amount of reserved memory and
prevents access to expanded memory. If you plan to run any applications that
need expanded memory and you're not running them in Windows 3.0 Enhanced
mode, substitute RAM for NOEMS. Using DEVICE = EMM386.EXE RAM tells it to
both manage and simulate expanded memory.)
If you've already used DOS = HIGH to specify that you want to run DOS in HMA
(and if you have an 80286, 80386, or 80486 with extended memory, which you
should), you can change the DOS=HIGH line to read
DOS=HIGH,UMB to take care of both instructions in one line.
(Loading order is important. The DEVICE= HIMEM.SYS command must be at the
top of your CONFIG.SYS file, followed by the DOS= command. Optional
third-party expanded memory managers should appear next, followed by device
drivers that use extended memory. Then comes EMM386-on 80386 or 80486
systems only-with a RAM parameter if you want it to use expanded memory, or a
NOEMS parameter if you don't. Device drivers using expanded memory come
next, followed by drivers you want to put into UMBs.)
Once you've issued the DEVICE=EMM386.EXE NOEMS and DOS=UMB commands, instead
of using the usual DEVICE= line to load device drivers via CONFIG.SYS,
substitute the new DOS 5.0 DEVICEHIGH= instruction instead. You can use this
technique to take ANSI.SYS, DISPLAY.SYS, DRIVER.SYS, EGA.SYS, PRINTER.SYS,
RAM-DRIVE.SYS, and SMARTDRV.SYS out of conventional memory if you have enough
UMB space. So to install ANSI in reserved memory, follow the previous lines
with
DEVICEHIGH=ANSI.SYS
You can store a handful of DOS utilities there as well: APPEND.EXE,
DOSKEY.COM (a powerful new command stacker and macro generator),
DOSSHELL.EXE, KEYB.COM, GRAPHICS.COM, MODE.COM, PRINT.EXE, NLSFUNC.EXE, and
SHARE.EXE. Or you can load your TSRs there. To have your AUTOEXEC.BAT file
put TSRs and DOS utilities into reserved memory, preface each with a LOADHIGH
(or LH) command. To load DOSKEY into a UMB, include this line in your
AUTOEXEC.BAT:
LOADHIGH DOSKEY
It's possible to store other programs in reserved memory. If you use the
LOADHIGH command and DOS runs out of UMB room, it will load the program into
conventional memory instead (but it won't tell you it's doing this). You can
later see where all of the programs are loaded by running the MEM/ CLASSIFY
(or MEM /C) command.
It's also possible for you to confuse your system by putting so much of DOS
in places where certain programs don't expect it to be. Say you load DOS in
high memory and try to run an EXE file that has always worked flawlessly. If
you get a "Packed file corrupt" message, preface the name of the.EXE file
with LOADFIX. This new workaround makes sure the program isn't loaded too
low in memory and gets it running properly.
One of the most annoying aspects of DOS 5.0 is that Microsoft didn't provide
a better way to sniff out what should be loaded where. Instead, it asks you
to juggle all the possible conventional, reserved, and high-memory
configurations yourself and run the MEM command each time to see what worked
and what didn't. This involves editing startup files, rebooting, logging
results, and so on, and few users are going to be bothered with such arduous
tasks. At the very least, Microsoft should have created a utility that notes
which settings save the most memory and give your system the best
performance. Optimize, Optimize The final way Microsoft helped with memory
problems was to concern itself openly with optimization for the first time.
It updated the SETUP program to streamline your CONFIG.SYS and AUTOEXEC.BAT
files a bit. And it filled the new manual with page after page of repetitive
tips on how to tune your system. Some tips save only a few bytes at a crack,
but it all adds up. While putting DOS and its buffers and caches high and
loading drivers and programs into reserved memory frees up the most RAM, the
suggestions Microsoft makes are valid. Most users probably don't understand
what all those bizarre CONFIG commands are anyway and have the defaults set
wastefully high. Some examples:
Either DOS or your programs have to deal with inevitable hardware interrupts.
Because some older programs can't do a proper job, DOS assumes the worst and
allocates nine interrupt "stack frames" of 128 bytes each, just in case.
Since you probably don't need this, adding a line to your CONFIG.SYS file
that says
STACKS=O,O can give you back more than 1K of memory. If your system then
freezes up or starts acting unusually flaky, remove this new line and see if
the problem goes away.
DOS normally assumes that you could have five drives, A: through E:. DOS 3.0
introduced the LASTDRIVE command, which lets you go all the way to drive Z:
so you can do things like put WordPerfect in drive W:. Unfortunately, each
drive past E: costs 80 to 190 bytes; If you currently use a LASTDRIVE=Z
CONFIG.SYS command, chopping off the drive letters you don't really need can
save more than 1K.
Don't slap too many caches into your system. Unecessary caches can slow
things down. Microsoft suggests ditching other disk-cache programs and
running as large a SMARTDRV cache as possible, up to 2MB, in extended memory.
It advises against running SMARTDRV in expanded memory created by EMM386.
Be sure to put enough buffers into your system.
While the optimal number of buffers should be based on the size of your hard
disk, previous DOS versions made decisions on the default buffer size based
on how much conventional RAM your system had. The joke is that while it can
assign five different levels of buffers, the top level of 15 buffers is for
systems with 512K to 640K. The new recommendations are based on hard disk
size:
Under 40MB 20 buffers
40 through 79MB 30 buffers
80 through 119MB 40 buffers
Over 120MB 50 buffers
The manual even suggests that you consider using a FCBS=1 command in
CONFIG.SYS to override the default of four. This command lets DOS know how
many file control blocks it can keep open at once. Since FCBs are an
anachronism, you probably can get away with a lower setting provided you're
not running any gasping, wheezing, ancient software. While paring the number
from four to one saves a trifling 176 bytes, every byte counts if your
programs won't load.
If you use a mouse just for Windows and nothing else, you can get rid of any
external MOUSE.COM drivers, since Windows contains its own internal one.
I Make sure any FASTOPEN settings aren't too high. FASTOPEN keeps track of
where files you've opened previously are located on your hard disk, so DOS
doesn't have to search the disk the next time you want to use them.
Microsoft now suggests a setting of one file per meg of hard disk space. The
previous version's default \&-as 34. Under DOS 5.0 it's 48. If you're using
a small hard disk, you can reduce the number to as low as 10. But if you
have a 100MB hard disk, upgrade pronto.
In fact, this upgrade is probably a good time to look at all the drivers and
TSRs you normally load to see if you really do use them.
The best recommendation of all, apart from putting DOS itself in HMA, is to
try and wedge all the little DOS housekeeping stuff, like DOSKEY and APPEND,
and anything that needs buffers, somewhere other than the lower 640K.
Many of the new memory enhancements were designed with Windows 3.0 in mind.
Each works well by itself, but together they're an unbeatable combination
(see Mat DOS 5.0 Does for Windows" below).
Fit and Finish
DOS users are like New Yorkers: Their daily routine is such a constant
struggle that they'll put up with just about anything. After years of
dealing with balky installation routines, arcane memory conflicts,
intentionally crippled utilities, terse error messages, bizarre escape codes,
inscrutable command switches, incomprehensible manuals, and the constant fear
that everything is going to vanish, be corrupted, and generally blow up in
their faces, DOS users shrug off operating system adversity.
So it's a genuine surprise and pleasure to see some of the finishing touches
Microsoft has applied to DOS 5.0. The DOS design team realized that DOS is
more than never saw them. DOS 5.0 incorporates them all.
DOS 4.0 took the first real steps to standardize the way the operating system
you love to hate parsed," or interpreted, commands. Instead of generating
the usual "Bad command or filename" voodoo, it zeros in and identifies
specific errors when it can't understand something you typed at the command
prompt.
Version 4.0 also introduced far friendlier disk formatting. Instead of
having to specify the number of tracks and sectors, you can specify the disk
size you want. To format a 720K disk in a 1.44MB drive, all you have to do
is add a /F:720 switch. It also lets you specify the volume label ahead of
time (with a V/:name switch). And instead of printing a useless report on
the changing number of drive heads and cylinders, it keeps you posted on the
formatting progress by displaying the percentage of the job completed. It
also adds a serial number to each disk, which the system uses to tell if you
switched floppies at the wrong time.
DOS 4.0's MODE command lets you change the keyboard "typematic" rate on newer
systems, which can speed things dramatically, especially if you like to
scroll your display or use your arrow keys to move around the screen.
(With DOS 4.0 or 5.0 and the right hardware, if you want to make time stand
still, issue the command
MODE CON RATE=1 DELAY=4 and then try using the arrow keys, or holding any
alphanumeric key down. Then type
MODE CON RATE=32 DELAY=1 and you'll think you're using someone else's hotter,
much more expensive system. If you like the effect-and you will-add the
second line to your AUTOEXEC.BAT file after your PATH statement.)
Speaking of screens, MODE also lets you increase the number of display lines
on the right video hardware, so long as ANSI.SYS is loaded. With VGA and a
DOS 4.0 or 5.0 MODE CON LINES= command, you can have DOS display 43 or 50
lines rather than the usual 25. Lengthsensitive utilities like CLS and MORE
will recognize the new screen sizes and adjust themselves to fit.
One of the best 4.0 utilities that made its way into DOS 5.0 is MEM, which
reports on all the various kinds and amounts of memory in your system and
provides a detailed memory map showing what's loaded where. DOS 5.0 makes
MEM even better.
Hide and Seek
When it comes to utilities, DOS 5.0 adds plenty of its own tricks.
Microsoft finally stopped overprotecting users and allowed ATTRIB to twiddle
hidden and system attributes. The standard DOS directory table contains a
byte that keeps track of each file's attributes. By manipulating four
different bits in this byte, DOS can give certain files special treatment.
One of these, the "archive" bit, can tell DOS whether its BACKUP or XCOPY
utilities (or a commercial backup utility) previously made a copy of the
file. This lets backup utilities skip over files that haven't been modified
since they were last backed up.
If you later change the file, DOS changes the attribute, which can tell any
backup utility that it needs to back up this new version. Another of these
attribute bits can make a file "read-only," which means that DOS will be able
to use the information in the file but not delete or change it.
With Version 5.0 DOS gives you access to the other two bits-"hidden" and
"system." You won't really need to take advantage of the system bit, but by
using ATTRLB +H FILENAME you'll now be able to hide files from normal
directory searches. ATTRIB -H FILENAME mill make them just as magically
reappear. (Third-party utilities that let users hide files have been around
for years. And power users have always been able to ferret out hidden files
with the CHKDSK/V command.)
DOS 5.0 offers an easier way to locate hidden files.
The vastly improved DIR command comes with four powerful new switches"-/A,
/0, /S, and /B, and one strange new switch, L. A switch is an option entered
at the end of the command line after a slash (like the /W for a wide display
or the /P for a paused display in DIR /W or DIR /P) that changes the way the
command works.
A file can have none of these bits "set" (turned on so DOS treats the file
specially), or any one, two, or three, or all four.
The new DIR /A switch, when used with an additional D, H, S, R, or A, will
display groups of files with certain characteristics: DIR (without any
switches) displays all files that
are not hidden or system DIR /A displays every file in the subdirectory DIR
/AD displays only subdirectories DIR /AH displays only hidden files DIR /AS
displays only system files DIR /AR displays only read-only files DIR /AA
displays only those files that have been
created or changed since the last backup
You can combine these, so that DIR /ARH (or dir /arh) will list only files
that are both read-only and hidden.
To reverse the process, just stick a hyphen in front of the appropriate
option. Typing DIR A-D removes subdirectory entries from the listing. DIR
A-D-R removes subdirectories and any read-only files.
The new /0 switch changes the order in which DIR lists files: DIR (without
any switches) displays files in the
order in which they happen to appear in the
directory DIR /0 first displays any subdirectories one level
down in alphabetical order, and then displays
all the files in alphabetical order DIR /ON sorts files alphabetically by
name DIR /OE sorts files alphabetically by extension DIR /OG displays files
in the order in which they
happen to appear in the directory, but lists
subdirectories before files DIR /OS sorts files by size, starting with the
smallest
ones DIR /OD sorts files by date and time, starting with the
oldest ones Adding a hyphen here flips things around: DIR 10-N sorts files
alphabetically by name in reverse
order DIR /0-E sorts files alphabetically by extension in
reverse order DIR O-G displays files in the order in which they
happen to appear in the directory, but lists
subdirectories after files DIR /0-S sorts files by size, starting with the
biggest
ones DIR /0-D sorts files by date and time, starting with the
newest ones
Just as with the /A switch, you can combine these options. Plus, you can
combine /A and /0 switches in the same command so that DIR /AH /0-D will
display every hidden file in the current subdirectory, with the newest one at
the top of the list.
The new IS switch tells the DIR command to list files in the current
directory as well as files in all the subdirectories below it. This can help
you find a file you've squirreled away somewhere on your disk but forgotten
exactly where. If a map of your hard disk looks like this and you're logged
into the \MOVIES\COMEDY directory, DIR /S brings up a list of all the
nonhidden files in that directory, as well as all the nonhidden files in the
two lower directories \MOVIES\COMEDY\ALLEN and \MOVIES\COMEDY\STURGES).
Entering this command while you were in the root directory would display
every unhidden file on your entire disk.
Even if you happen to be in one of the lower-down subdirectories, you can
also have DOS list every file on your disk by typing DIR \ /S. The backslash
(\) tells DOS to start in the root directory.
If you do use the /S switch, you'll probably want to use the /P switch with
it to pause the display a screenful at a time. Otherwise DOS scrolls lots of
files in lots of subdirectories so fast you won't be able to read them.
Another way to freeze and unfreeze any scrolling DOS display is with Ctrl-S.
Issue the appropriate DIR command, then quickly hold the Ctrl key down, and
press the S key. The display should freeze. Then, holding the Ctrl key
down, press S a second time, and the display should resume scrolling. Press
it a third time (the Ctrl key must still be held down) and it will again
freeze. This Ctrl-S key combination "toggles" displayfreezing on and off.
Since the /S switch will look through multiple subdirectories at once, you
can use it to find lost, misplaced, or similarly named files. Assuming you
haven't hidden any subdirectories, if you know there's a file called
SCRIPT.LST on your disk but can't remember where it's stashed, you can just
type
DIR \SCRIPT.LST /S
DOS 5.0 will display the normal directory listing for that file and tell you
which subdirectory it's stored in. If you have multiple copies of a file
with that name (you'd be surprised how often this happens), DOS will display
all copies of it, along with the subdirectory where each copy is stored, and
tell you how many files with that exact name are on your disk.
The initial \ preceding the SCRIPT.LST filename is important because it tells
DOS to begin looking in the root directory. By using wildcards in your DIR
/S search, you can have DOS uncover groups of similarly named files. To find
every file on your disk that begins with the letters SCRIPT," you'd just
type
DIR \SCRIPT*.* /S This would list files like
SCRIPT.LST
SCRIPT2.LST
SCRIPT.OLD
SCRIPT91
SCRIPT90.WKS that were in various subdirectories, along with the names of the
subdirectories in which they were located.
Or you could scope out every old .WKS spreadsheet Me on your disk by typing
DIR \*.WKS /S
The two other new DIR switches, /B and /L, are far less complex. DIR /L will
display the output in lowercase text rather than the usual uppercase letters,
a feature useful only to nostalgic Unix hounds.
The DIR /B switch is actually very useful. It strips out all the
nonessential information from the directory listing, leaving just the
filename and extension. It also removes extra spaces before the extension
and adds a dot. So instead of seeing normal DIR output like this:
Volume in drive C is MUGWUMP
Volume Serial Number is 1673-B70E
Directory of C:\DOS
01-26-89 3:08p
01-26-89 3:08p
FOFMAT COM 32945 03-08-91 5:05a
NLSFUNC EXE 7052 03-08-91 5:05a
COUNTRY SYS 16741 03-08-91 5:05a
DISPLAY SYS 15792 03-08-91 5:05a
HIMEIM SYS 11488 03-08-91 5:05a DIR /B will give you a bare-bones
FORMAT.COM
NLSFUNC.EXE
COUNTRY.SYS
DISPLAY.SYS
HIMEM.SYS
This can be very useful when you're using the output of a DIR search to
automate a tedious process. If you want to erase all the .BAK backup files
in all your subdirectories, you can type
DIR \*.BAK /S /B > DELBAKS.BAT You'll end up with a Me called DELBAKS.BAT
that looks like this:
C:\AUTOEXEC.BAK
C:\TAXES\1990.BAK
C:\TAXES\1991.BAK
C:\TAXES\EXPENSES.BAK
C:\WINDOWS\WINWORD\PETA.BAK
Just use your word processor or the new EDIT utility's CHANGE command to
replace every C: with DEL C: and then run the DELBAKS.BAT batch file. Every
space-wasting.bak file will vanish. With previous DOS versions you would
have had to spend much more word processor time fiddling with the DIR output.
The only problem with DIR /B is that it includes subdirectory names along
with the other filenames. But you can add a /A-D switch and get lid of
these.
The final new DIR wrinkle is that you can use a new environment variable
called DIRCMD to create a new DIR default. The environment is a special
slice of memory DOS uses to store values for key variables like your PATH,
your PROMPT, COMSPEC (the location of your main copy of COMMAND.COM) and now
your DIR "tail"-the list of switches and options that it will use.
Typing DIR by itself normally yields the same verbose, unsorted, scrolling
mess you're accustomed from older versions. But if you type a line at the
DOS prompt like
SET DIRCMD=/ (or include this line in your startup AUTOEXEC.BAT file), the
next time you type DIR, DOS will automatically stick on the /P /0-D /A-D
switches and display your files without subdirectory entries, with the most
recent files at the top of the list, one screen at a time. You can use the
SET DIRCMD= command to change the default as often as you like. Be sure you
have enough environment space. The usual default is 160 bytes, but Version
5.0 installation may try boosting this number to 256. If you receive an
error message telling you that you're out of environment space, make sure DOS
lops off a few hundred more bytes with this line in your CONFIG.SYS file:
SHELL=\COMMAND.COM /E:512 /P Helping Hand You might look at the new tangle of
DIR switches and options and complain that Microsoft just made life at the
keyboard even more of a headache than it was with older versions. If so,
you're partially right. Microsoft should have included a graphical
control-panel checkbox utility that listed all the DIR options and actually
wrote out the string of command-tail switches for them. Then you'd either
tab from option to option or use a mouse to pick the options you wanted. But
remember, this is DOS. It's not supposed to be soft and warm and friendly.
It assumes users are smart and patient enough to look at the syntax and
figure it out. And just watch-soon enough someone will write a tiny utility
program that handles things like this. For now, Microsoft eased things for
the rest of us by adding the bare essentials of online help, on two levels.
The first level is pretty basic if you need to know which command does what
and how to spell it, and you'll be satisfied with just a few words of
explanation type HELP by itself at the command prompt. DOS will print out a
screenful at a time of terse information about all the main commands
(generally one command per line and listed alphabetically, with the commands
on the left and brief synopses on the right.
The second level is more useful and (thankfully) more detailed, although it
cries out for examples and additional explanation. Obviously this was meant
as a reminder for the user who knows what afl the commands do and how to use
them but can't remember off the top of his or her head a detail like which
letter to put after DIR /0 to display subdirectories first (the answer is G).
You can access this second level in two ways, either by typing the command
itself with a /? switch, or by following the word HELP with the name of the
command. So DIR/? and HELP DIR will yield the same 25-line (or less)
screenful of syntax.
In some cases, as with DIR or the new Version 5.0 DOSKEY command, DOS barely
manages to squeeze all the vital facts into one screen. In others cases, as
with the TIME command, it's unnecessarily brief and leaves out important
information (like the TIME command's optional A I P AM/PM feature).
In most cases, DOS provides three HELP elements: a short one- or two-line
description of what the command does (the same one that appears in the
first-level help summoned when you type HELP by itself), the bracketcrammed
generalized syntax that's been in the DOS manual for years (for example,
PRINT [/D:devicel [/ B:size] [/U:ticksl] [/M:ticks2l [/S:ticks3l [/Q:qsizel
[/Tl [[drive:][path]filename[ ...]] [/C][/P]), and the tiniest possible
explanation of what each switch controls (for example, /S:ticks3: Allocates
the scheduler the specified number of clock ticks for background printing").
Microsoft uses something called Backus-Naur Form" to indicate syntax. The
rules are simple:
I means or," as in ECHO [ON I OFF]
0 means a group of things, as in FOR variable
in (set) ...
[I means an option, as in ECHO [ON I OFF)
means a multiple option and is not currently
used
Capital letters are keywords," as in ECHO [ON
OFF]
Lowercase letters are identifiers" that are replaced
when you enter the command, as in ECHO [messagel
In a very few cases the help screen will also toss in a few words on how
something works ("If a pathname is not specified, FIND searches the text
typed at the prompt or piped from another command.").
In virtually all cases, a few optional screenfuls of additional information
would have made HELP far more useful. For instance, the MODE command lists
as one of its eleven options
Typematic rate: MODE CON[:] [RATE=r DELAY=d]
This is helpful only if you know the following: 1. What "typematic rate"
refers to. 2. How useful this feature, which can dramatically speed
up scrolling, cursor moving, and repetitive typing,
truly is. 3. What the possible values and defaults are and what
they'll affect. (For instance, r can vary from 1 to 32; a
value of I means that holding down a key will make it
repeat onscreen at the rate of 2 per second while a
value of 30 means it will repeat 30 times a second; the
default is 20 for AT-style keyboards and 21 for enhanced
keyboards.) would yield every help listing with the text string copy" in
either the command name or the description:
COPY copies one or more files.
DISKCOPY copies the contents of one floppy disk
to another.
XCOPY copies files and directory trees.
This works by searching through the DOS 5.0 DOSHELP.HLP text Me for words or
parts of words you specify. It isn't perfect; some of the descriptions in
DOSHELP.HLP wrap down to the next line.
QUIKHELP.BAT uses one long-awaited DOS 5.0 feature enhancement-the FIND
filter in past versions was case-insensitive. If you wanted to look for the
word "filename" in a file, you had to make it search for filename," "FILENAME
... .. Filename," and, in this crazy computer business, probably even
"Filename". And if by chance the word appeared as Fllename", you were out
of luck. Now, by tacking on a /I switch, you make FIND searches ignore the
case of the text.
Black (and White) Isn't Beautiful
Just as Henry Ford once offered a Model T in any color so long as it was
black, DOS out of the carton still lets you clear your screen to any color,
so long as the colors are gray on black. You can, of course, use ANSI. If
you've booted with a line in your CONFIG.SYS that says
DEVICE=ANSI.SYS or if you've used EMM386 to put ANSI in reserved memory, with
DEVICE=EMM386.EXE NOEMS
DOS=UMB
DEVICEHIGH=ANSI.SYS you can then change your screen colors to something like
red on white with a COLORSET.BAT batch file:
@REM This is COLORSET.BAT
@REM It sets colors to red on white
@SET OLDP=%PROMPT%
PROMPT $E[31;47m
PROMPT=%OLDP%
@CLS
@SET OLDP= The fourth line of COLORSET.BAT includes the ANSI codes for red
foreground text (31) and white background text (47). If you wanted to set
the colors to white foreground text (37) on a blue background (44), you'd
change the fourth line to
PROMPT E[37;44m
You can also patch COMMAND.COM to clear the screen to any color combination
so you don't have to load ANSI.SYS. To do this, you first have to locate the
hexadecimal address of the byte that controls the clearscreen color.
To find the address of the color-controlling byte in any version of DOS, use
DEBUG'S powerful search (S) command to look for the appropriate
assembly-language instruction. In recent versions of DOS, the instruction is
MOV BH,07
(0 as the lefthand value produces the black background; the 7 on the right
yields the gray/white text color).
In some older versions, it's
MOV BX,0700
These instructions simply set things up for a subsequent BIOS interrupt
(hexadecimal INT 10) that actually changes the color. To locate the byte
that stores the color information, tell DEBUG to peek inside the COMMAND.COM
program and look for all the places Interrupt 10 is invoked.
COMMAND.COM stores the INT 10 instruction in a sort of shorthand notation as
two successive hex numbers, CD 10. To find this pair of hex numbers, first
use DEBUG'S RCX command to see how long your particular COMMAND.COM file is
(and then press the Enter key twice to tell DEBUG you want to look at the
length, not change it). Next, use the DEBUG S command to start searching
from the beginning of the program-which is always address 100 for A.COM
file-and keep searching for the program's entire length. Finally, pick the
lowest address that the search command uncovered, replace the two rightmost
digits of that address with 00, and use the U (unassemble) command to search
for a nearby MOV BH,07 or MOV BX,0700.
When using the U command for the first time, follow it with the address you
found (but replace the two rightmost digits with 00). DEBUG will show you a
short chunk of the program's assembly instructions, but it probably won't
uncover the MOV BH,07 right away. Issuing the U command a few more times
will, but make sure you issue subsequent U commands without an address after
the U. When unassembling a continuous slice of memory, you have to enter the
starting address only the first time you issue the command. Afterward, you
can simply type U and press Enter. When you're all done, type Q to quit.
The whole thing looks something like this:
C>DEBUG \COMMAND.COM
-RCX
CX BAE5
-S 100 L BAE5 CD 10
22CC:432B
22CC:4337
22CC:435F
22CC:436C
22CC:4370
22CC:4376
U 4300
[enter U a few times here]
u
22CC:4366 B406 MOV AH,06
22CC:4368 B707 MOV BH,07
22CC:436A 32DB XOR BL,BL
Q
Remember to press Enter twice after typing RCX. Note that in the previous
example, both the S and U commands produced addresses that begin with 22CC.
This number will probably be different on your system and doesn't matter
here. The rest of the numbers do matter.
The number after the 22CC and the colon is the actual address of each
instruction. The "shorthand" assembly- language version of each instruction
follows the address (in the previous example the one you want is B707).
The above example tells you that the actual colorchanging instruction is two
bytes long (B7 is one byte and so is 07). If the color-changing instruction
your search found was
22CC:2BAB BB0007 MOV BX,0700 the color-changing instruction would be three
bytes long (BB, 00, and 07).
This is important because the address DEBUG locates is always the starting
address of the whole instruction and not the address of the specific part of
the instruction that COMMAND.COM uses to store color values. With a two-byte
version, the address of the color-value part is one byte higher than the
starting address. With a three-byte version, the address of that value is
two bytes higher.
In the above example the starting address of the instruction is 4368. But
since the critical byte is the second of the two numbers in the pair, add 1
to it: 4368+1=4369. (Remember, you're dealing with hex, where the digits go
1,2,3,4,5,6,7,8, 9,A,B,C,D,E,F, 10. So if your search returns a hypothetical
starting address like 4369, adding one to it would yield 436A, not 4370.)
Once you think you've found the address of the color value, test it by using
the DEBUG D ("display" or "dump") instruction. Follow the D with the actual
address of the value byte (not the starting address of the whole instruction)
and then L1 to tell DEBUG to display a chunk of memory with a length of just
one
C>DEBUG \COMMAND.COM
-D 4369 Ll
22CC:4369 07
Q
C>
If you see an 07, you've probably found the right patching address.
Otherwise, go back and begin the search again.
Once you've found the correct address, you can make a patch. Whenever
patching COMMAND.COM, be very careful about what you type. And before you
start, create a bootup floppy. Put a blank diskette in drive A: and type
FORMAT A: /S
and then
COPY C:\DOS\SYS.COM A:
If you later make a mistake and you find you can't boot off your hard disk,
stick the bootup floppy in drive A: and boot off of it. Then, to fix things,
type
SYS C: and then
COPY COWAND.COM C:\
To patch COMMAND.COM be sure DEBUG.COM is handy. Make a backup copy of
COMMAND.COM called COMMAND.BAK, then type
DEBUG COMMAND.COM and press Enter. At the DEBUG prompt, type the letter E
followed by a space and the hexadecimal address you found by following the
previous instructions:
E 4369 Press Enter. You should see two pairs of four hexadecimal numbers,
then two spaces, then the 07 clear-screen-color byte followed by a period.
If you don't see this, press the Enter key again, Q to quit, and Enter one
last time to return to the DOS prompt. Then try again.
However, if you do see the 07, enter 71 (or any other color you'd like as
your clear-screen color) directly after the period. Remember, the left-hand
digit controls the background color, and the light-hand one produces the
foreground, or text, color. Choose your color scheme from the following
list:
Black 0
Blue I
Green 2
Cyan 3
Red 4
Magenta 5
Yellow 6
White 7
Don't use anything higher than 7 on the left or your screen mill blink. Once
you've entered the new colors, press Enter to return to the DEBUG command
prompt, then type W and then press Enter to make the changes stick; type Q
and press Enter to finish and return to DOS. The whole thing should look
something like this:
C>COPY COMMAND.COM COMMAND.BAK
C>DEBUG COMMAND.COM
-E 4369
22CC:4369 07.71
W
Writing OBAFB bytes
Q
C>
(The first nine characters in' probably be different. Again, ignore them.)
Reboot, then type CLS. If it to blue on white, see if t CONFIG.SYS file that
says something like
DEVICE=C:\DOS\ANSI.SYS If so, use your word processor or utility to insert a
REM at the beginning of this line and reboot.
If you decide to put things back the way they were and get rid of the patched
version of COMMAND.COM, type:
COPY COMMAND.BAK COMMAND.COM
DEL COMMAND.BAK
Finally, make sure you don't have different versions of COMMAND.COM that DOS
can find on the same disk. DOS can become confused and lock up your system.
Next Month.- Tips on using DOS 5.0's new MIRROR, UNFORMAT, and UNDELETE
commands, and everything you need to know about DOSKEY, EDIT, and QBASIC.
Plus, DEBUG scripts and batch files for formatting disks via menus, and
programs that automatically load and unload DOS macros.
============================================================
AUGUST, 1991
VERSION 5.0 IS THE FIRST RELEASE of DOS in years to introduce significant
changes both to the underlying architecture of the operating system and to
the roster of utilities it offers. Last month's installment of this two-part
article focused on the formidable new array of memory tricks, the far more
capable and friendly SETUP process, the new online help facility, and the
much improved DIR command.
Part 2 highlights several other new features that vill make DOS 5.0 a
must-buy for most users. Two of these additions replace parts of the DOS
package that were starting to look a bit ragged around the edges: EDIT, a
full-screen editor that understands Word and WordStar commands and supersedes
the dreaded EDLIN; and QBASIC, a powerful noncompiling implementation of
Microsoft's QuickBASIC programming language that gives BASICA/GWBASIC a real
shot in the arm by providing puu-down menus, mouse support, online help, and
superb debugging tools.
But they're only part of the story. For years, users have heaped thanks on
the "oops" protection supplied by recovery programs such as The Norton
Utilities, while wondering why these kinds of undelete and unformat utilities
didn't come with DOS. Now, with the help of a trio of programs licensed to
Microsoft from Central Point Software, they do. Or rather, they undo.
And if that's not enough to make you run out to buy the upgrade, just wait
until you try Microsoft's hot new DOSKEY. If you hate typing thorny DOS
commands, then retyping them, moving into the correct subdirectory, retyping
the !@#$% things, and then realizing a minute later that you need to type
them yet again, you'll flip over this great new tool. DOSKEY not only makes
it a snap to issue dozens of previous commands with single key strokes but
throws in a muscular macro language that can really make your system purr.
The new DOS includes the usual grab bag of other enhancements and fixups,
including improvements to commands that have survived from earlier versions.
Beyond Compare
The COMP command is a survivor; it's one of only a dozen or so utilities that
have been around since the beginning Version 1.0). And it shows. COMP used
to choke if you tried to compare two files that were even one byte different
in size or if it found more than 10 differences between the files. That made
it useful only if you were verifying that two copies really were identical or
if there were just a few tiny differences. The DOS 5.0 version of COMP
likewise refuses to budge if you try to compare two files of different sizes.
But a new feature lets you trick it into working. By adding a /N = nnnn
switch, you can have it cheek the first nnnn lines even if the files are
different sizes. So to have it compare two files of different lengths, just
specify a very high nnnn number, like /N = 999999. To compare your, current
AUTOEXEC.BAT file with an AUTOEXEC.OLD file, for instance, you'd type
COMP AUTOEXEC.BAT AUTOEXEC.OLD /N=999999
Even the new version of COMP will abort after 10 mismatches, though. DOS 5.0
added four other semi-useful switches to the COMP command. While COMP
normally displays any differences it finds in hex notation, COMP /D will
produce decimal results, and COMP /A the actual ASCII characters that are
different. COMP /L will display the line numbers that contain the
differences rather than the differences themselves, and COMP /C makes the
comparison case-insensitive. A better bet, although still not a perfect
solution, is the more flexible FC file comparison program, which Microsoft
has long been distributing in non-IBM OEM versions. Now that Microsoft is
selling directly to users, it can make FC the standard.
Slower and Fuster
The FORMAT command is another survivor. Over the years, as vendors added
disk types, Microsoft has had to enhance the FORMAT command to keep up. DOS
5.0 has to deal with eight different floppy formats (160K, 180K, 320K, 360K,
720K, 1.2MB, 1.44MB, and the new 2.88MB). This proliferation of drive types
has been a mixed blessing. Since today's systems come with only two drive
sizes (3 1/2 inch and 51/4 inch), each size can handle four different
formats. To mix and match properly, users have had to rely on an
increasingly odd welter of FORMAT switches. The new FORMAT /? or HELP
FORMAT) command can remind you which switch does what. Or you could use the
following MFORMAT.BAT (for Menu-drive FORMAT) batch file to handle the most
common formatting tasks automatically. MFORMAT.BAT will format 360K, 720K,
1.2MB, 1.44MB, or 2.88MB disks in drive A: or drive B: simply by letting you
select menu choices. For the command to work properly, FORMAT.COM has to be
handy, and it needs a tiny new program called SNIFF.COM. To create this
program, use a pure ASCII word processor to type in the following script
file, called SNIFF.SCR:
E 100 B4 00 CD 16 3C 00 74 F8 3C IB 75 05 BO FF EB 1B
E 110 90 3C 31 72 EB 3C 36 72 12 24 5F 3C 41 74 OC 3C
E 120 42 74 08 3C 4E 74 04 3C 59 75 D5 B4 4C CD 21 C3
N SNIFF.COM
RCX
30
W
Q
Be sure to leave an extra blank line after the final Q.
To create SNIFF.COM, make sure DEBUG.COM is
handy and type
DEBUG < SNIFF.SCR
Then use your pure ASCII word processor to create
MFORMAT.BAT:
@ECHO OFF
REM This is MFORMAT.BAT
:SIZE
CLS
ECHO ==== CHOOSE A DISK SIZE
ECHO I 360K
ECHO 2 720K
ECHO 3 1.20M
ECHO 4 1.44M
ECHO 5 2.88M
ECHO (Or press Esc to quit)
SNIFF
IF ERRORLEVEL 265 GOTO BYE
IF ERRORLEVEL 54 GOTO SIZE
IF ERRORLEVEL 53 IF NOT ERRORLEVEL 54 SET
SIZ=2.88MB
IF ERRORLEVEL 52 IF NOT ERRORLEVEL 53 SET
SIZ=1.44MB
IF ERRORLEVEL 51 IF NOT ERRORLEVEL 52 SET
SIZ=1.2MB
IF ERRORLEVEL 50 IF NOT ERRORLEVEL 51 SET
SIZ=720K
IF ERRORLEVEL 49 IF NOT ERRORLEVEL 50 SET
SIZ=360K
:DRIV
CLS
ECHO ==== CHOOSE A DRIVE ===
ECHO A Drive A:
ECHO B Drive B:
ECHO (Or press Esc to quit)
SET DRV=
SNIFF
IF ERRORLEVEL 255 GOTO BYE
IF ERRORLEVEL 67 GOTO DRIV
IF ERRORLEVEL 66 IF NOT ERRORLEVEL 67 SET
DRV=B:
IF ERRORLEVEL 65 IF NOT ERRORLEVEL 66 SET
DRV=A:
IF !%DRV%==! GOTO DRIV
:CHECK
CLS
ECHO Format drive %DRV% for a %SIZ% disk (Y/N)?
SNIFF
IF ERRORLEVEL 255 GOTO BYE
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 GOTO DOIT
IF ERRORLEVEL 78 IF NOT ERRORLEVEL 79 GOTO SIZE
GOTO CHECK
:DOIT
FORMAT %DRV% /F:%SIZ%
:BYE
SET SIZ=
SET DRV=
MFORMAT.BAT obviously can't do the impossible (like format a 51/4-inch disk
so it holds 1.44MB). And if you're using DOS 5.0, it will perform a "safe"
format (more on this below).
Safety Net
In earlier DOS versions, formatting expunged any files that happened to be on
the disk. One wrong keystroke, and you could kiss your programs and data
goodbye. DOS 5.0 is a lot more forgiving.
All versions of DOS use two tables to keep tabs on every file: the directory
and the file allocation table (or FAT). The directory stores the name of the
file, the date you created or last changed it, its size, the file's
"attribute," and a connection to the FAT. AU but the tiniest files are
stored by DOS in small chunks called clusters; the FAT keeps track of where
each cluster is on the disk. DOS prefers to call clusters "allocation
units," and it tells you how many of these are on your disk and how large
they are whenever you use the FORMAT or CHKDSK commands.
(Actually, a disk can contain lots of directories. Generally when people
refer to the directory they mean the root" directory at the physical
beginning of the disk. Subdirectories are actually separate files coded a
special way so that DOS can look inside them for the needed name, size, date,
attribute, and FAT entry information.)
Formatting sets up a blank new root directory and a new FAT, wiping out
filenames and the whole map of any existing clusters. (It also normally
scans the disk for "bad" areas that might corrupt your data and marks these
so it can avoid them later.) But depending on what DOS version you're using
and what FORMAT command you issue, it may leave intact the clusters
containing the parts of the files themselves. If the data is still there,
and you managed to tell DOS to store a copy of the root directory and the FAT
somewhere, you could put things back the way they were after an accidental
format and prevent disaster.
Several third-party vendors have been selling utilities for years that could
do just that. To give this capability to DOS 5.0, Microsoft made a deal with
one of these vendors, Central Point Software, maker of PC Tools Deluxe, for
three utilities that can give you new peace of mind-MIRROR, UNFORMAT, and
UNDELETE.
Typing MIRROR at the DOS prompt saves the crucial root directory and FAT
information to a file that allows UNFORMAT to recover it. It also keeps
track of this "system area" information for each file that's subsequently
deleted, creating a deletion-tracking file that makes it possible for
UNDELETE to work.
Putting a MIRROR instruction in your AUTOEXEC file will ensure that this
crucial information is saved every time you boot up. It's good practice to
do this, and to type MIRROR at the DOS prompt every so often if you've been
at the keyboard for hours since booting up.
It's also prudent to save your hard disk's partition data to a floppy by
using the MIRROR /PARTN switch. Curious users can also see what their hard
disk partition tables look like by typing UNFORMAT /PARTN /L.
If you're the belt-and-suspenders type, you may want to use the safest MIRROR
feature of all, loading it as a memory-resident program that can track up to
999 files and keep the deletion-tracking file current. To do this, add a /T
switch and follow it with the drive you want it to watch and the maximum
number of files it can juggle (the default varies from 25 for a 360K floppy
to 303 for a hard drive larger than 32MB). If you haven't loaded any other
TSRs after MIRROR /T and you suddenly need to free up RAM, you can unload the
resident copy of MIRROR with a MIRROR /U. This makes MIRROR yet another TSR
that wants to be loaded last-as well as a walking advertisement for OS/2.
MIRROR can create a very large deletion-tracking file if you keep it busy
on a large hard disk. Each time it updates the file, it normally makes a
backup copy of the previous tracking file. If you are tight on disk space
and want it to dispense with backups, use a MIRROR /1 switch.
Once you've used MIRROR (or formatted a disk without the /U switch), you can
test whether DOS can recover everything by typing UNFORMAT /TEST. The
messages onscreen are a little scary, but every so often the program will
print a "Simulation only" line that should lower the hair on the back of your
neck. Typing MIRROR J (the J stands for "Just checking") will let you know
if everything is OK. The /TEST switch steps UNFORMAT all the way through the
restoration process but does not write anything to the disk. The i switch
simply cheeks that the MIRROR file is valid and that its contents match the
existing system files.
The DOS 5.0 FORMAT command contains MIRROR code that automatically performs a
"safe" format and squirrels away the root directory and FAT information. Now
when you format a disk that's already been formatted, you'll notice a delay
and a couple of new messages will show up:
Checking existing disk format.
Saving UNFORMAT information.
If there's room on your disk, DOS then saves the critical "system area"
information. When you type DIR you won't see anything, but it's there. If
you then immediately discover that you put the wrong disk in the wrong drive
and that you really didn't want to format your only copy of all your
financial records and your life story, just type UNFORMAT followed by the
appropriate drive letter, and all the vanished files will miraculously
reappear. This won't work if you add files to the disk, so try to catch such
blunders as soon as you make the accidental format.
If you want to format a disk to get rid of the existing files once and for
all, or if you're formatting a brand-new disk right out of the carton, you
can speed up the process and do an "unconditional" format by typing FORMAT
U. This won't do a safe format and won't create a hidden file that can
resurrect data later.
If you want to do a really quick format on a disk that has been previously
formatted, type FORMAT /Q. This command will blitz out a new blank root
directory and FAT, but it won't chug through the data area searching for bad
sectors. FORMAT /Q will, however, perform a safe format.
Microsoft notes that FORMAT Q and MIRROR won't work on 160K or 320K disks
formatted with versions of DOS earlier than 5.0. 160K disk users should take
heed ! The Road to Recovery
Inadvertent formatting isn't the only thing that can go wrong with your
disks. It's hard to believe that tens of millions of users entrust so much
vital information and so many expensive applications to what is really a
piece of flimsy plastic with rust on it. If you stopped for a minute and
realized how incredibly fragile your disks are, you'd probably back
everything up. Well ... at least you'd think about doing it.
Dust and dirt and grime can ruin all or part of a disk. So can spilled
coffee or soda. Stray electronic fields can wreak havoc. Who knows-maybe
even cosmic rays can zap out a few bytes here and there. A bumped, kicked,
or dropped hard disk can spell real trouble. And if you store your floppies
by pinning them up with refrigerator magnets, you're doomed.
Physical damage isn't the only danger-software itself can create problems.
If errant code somehow corrupts your directory, the FAT, or the partition
table on a hard disk, you can end up with a real mess where your files used
to be. And if you try to use the DOS RECOVER command on your whole disk, you
can experience firsthand the ultimate MIS nightmare.
But with DOS 5.0, such things may not be as bad as they initially seem. If a
lightning bolt has turned your system into toast, sorry, you're out of luck.
But if some renegade software or a sloppy keystroke at 3 a.m. or a RECOVER
C: has sent your system area information into never-never land, and you've
previously used the MIRROR command, typing UNFORMAT will make a valiant
effort to rebuild everything.
These commands are good, but they're not mind readers. They'll only put
things back to the state they were in when you last saved a MIRROR Me. You
can tell UNFORMAT to ignore a MIRROR file, if the only MIRROR file on the
disk is so old that it doesn't reflect the many changes you've made to the
disk since its creation. To do this, issue an UNFORMAT IU command, which
will try to reconstruct things by looking at the information in the current
root directory and FAT.
Fragmentation can cause headaches for any utility that is designed to piece
together something that's broken. If you're using a disk formatted ages ago,
and you've churned it like crazy adding and deleting files for months or
years, odds are that at least some of your files have their contents
scattered widely across the surface. Without a current MIRROR file, UNFORMAT
can't always chase all the parts down. If this happens, it will offer you
the option of truncating the file or deleting it-a real Hobson's choice. If
it's data, keep as much as you can. If it's a program, kiss it goodbye.
Using MIRROR frequently will prevent the need for such deliberations.
Hello Again
Being able to breathe new life into a disk after an accident is a welcome new
DOS feature. But most users don't find themselves needing such a feature
very often.
What is needed is a way to recover mistakenly deleted individual files. Such
mistakes are all too easy to make with DOS. But accidents like deleting the
wrong file are usually not tragedies. DOS doesn't actually wipe out files
when you use the DEL or ERASE commands; it just alters the internal tables
that keep track of what files are where, and leaves the actual data alone-at
least until you start adding and changing files on your disk.
The first major program to take advantage of this was Peter Norton's UNERASE.
Paul Mace, Central Point, and others quickly came out with their own tools,
and Norton eventually offered an automated idiot proof version that even an
utter DOS novice could use successfully. Fortunes were made on this
technique.
DOS 5.0 comes with a version of Central Point's UNDELETE utility. As with
the other file recovery programs now distributed by Microsoft, this one works
much better if you've told MIRROR to record everything that you've deleted.
(If you want it to do so automatically on a drive C: larger than 32MB and
have it keep track of up to 303 deleted files, add a MIRROR /TC command to
your AUTOEXEC.BAT file.)
But even if you haven't used the MIRROR command, UNDELETE can usually bring
'em back alive if you catch your mistake light away and if your disk isn't an
unholy fragmented mess.
You can tell UNDELETE to recover everything without your intervention, or you
can have it prompt you all along the way.
If a deletion-tracking file exists, you can type UNDELETE /ALL, and DOS will
try to recover every erased file it can find in the current directory, based
on information in the MIRROR Me.
If UNDELETE doesn't find a MIRROR file, it will tell you how many erased
files are in the directory and how many of these it could reconstruct using
the DOS system area, but it won't actually rescue these files. Don't worry:
If you haven't maintained a MIRROR file and you want UNDELETE to bring back
every erased file automatically, just tack on a /DOS switch along with the
/ALL, and UNDELETE will try to reconstruct things by snooping through the
directory's DOS system area.
However, DOS always gets rid of the first character of each filename when it
erases a file. If you haven't used MIRROR to create a record of what was
erased, UNDELETE won't know what the first characters of your erased files
actually were and will normally replace these unknown characters with #
signs.
Deleted files that had similar names are a bit trickier to rescue. If you
erased files called BOOK.TXT and COOK.TXT without using MIRROR, UNDELETE will
see two deleted files called _OOK.TXT. It will replace the first character
of the first file with a #, then use a % sign to begin the second. If it
later sees other erased _OOK.TXT files, it will next use a & sign, then a
hyphen, and finally start working its way through all the digits and the
letters of the alphabet. When it's done, you can rename them properly.
You generally won't have to worry about oddly resurrected filenames like
#OOK.TXT and %OOK.TXT if you've used MIRROR properly, since the
deletion-tracking file will remember the actual names. However, if you did
use MIRROR, and you typed UNDELETE /ALL hoping to have the command work
without prompting you for names, and if the UNDELETE command stumbles over a
filename in the deletion-tracking file that already exists on your disk, it
will stop and ask you either to come up with a new name for the file that you
want to undelete or to press the F5 key in order to bypass its rescue.
You can narrow the automatic recovery process so that UNDELETE; restores just
a selected group of files and not every erased file on your disk. Say you
wipe out all of your.BAK files and then realize that you actually need some
of them. If you've told DOS to maintain a MIRROR file, just type
UNDELETE \*.BAK /ALL
If you haven't maintained such a MIRROR file, add a /DOS at the end, and
UNDELETE will try to figure things out by looking through the directory and
FAT:
UNDELETE \*.BAK /ALL /DOS
Or you can make the process interactive by typing UNDELETE /DT (to use the
deletion-tracking file information), or UNDELETE /DOS (to ignore any tracking
file and use the existing DOS system area information instead). This way you
can decide whether you want to restore each erased file, and you can give it
back its proper name on the spot. You can also see what erased files
UNDELETE could recover, but not actually bring the files back, by typing
UNDELETE /LIST.
Key Feature
Did you ever enter a ridiculously long DOS command only to find that you were
in the wrong directory or on the wrong drive? You have to stop, move to the
right place, and then retype the ugly command all over again.
Ever realize that you were typing the same few DOS commands over and over to
do repetitive tasks, but with enough variation that a-batch file wouldn't
handle things properly?
Ever wish DOS came with its own macro language? One of the nicest DOS 5.0
surprises of all is the sensational new DOSKEY command stacker and macro
generator. It's not perfect-it can't create macros that pause halfway
through a command, prompt you for information, and then continue executing,
for example--but it will come in handy more often than you think.
Users have known and loved the F3 function key shortcut for years. Press it
at the DOS prompt, and your previous command magically reappears. Until now
you weren't able to re-execute the command before the last one. Or the one
before that. But with DOSKEY loaded, you can. And it will let you do far
more than simply dredge up old commands.
To install it, just type DOSKEY. Or, if you have some extra reserved memory,
type LOADHIGH DOSKEY. It takes up about 4K of RAM-about as much as ANSI.SYS.
And it's easily worth the space. For best results, add the LOADHIGH DOSKEY
or DOSKEY line to your AUTOEXEC.BAT file.
Once it's loaded, you can create macros at the command line by following the
DOSKEY command with the name of the macro and a definition.
Let's say you were working on something sensitive and wanted to keep your
system running while you went to lunch, but you didn't want anyone in your
office to walk over and examine the confidential files. One solution is to
use the ATTRIB command with the new /H switch to temporarily hide the files
from prying eyes, and later unhide them. To have DOSKEY help you do this,
type
DOSKEY HIDE=ATTRIB +H *.*
This creates a macro called HIDE that gives all your files (except certain
system ones) a "hidden" DOS attribute. This will bar the files from
appearing when someone types DIR.
To create the UNHIDE macro that will restore things back to normal, use
another feature of DOSKEY. Press the up arrow once, and the last command
will appeal- at the DOS prompt. Position the cursor over the + using the
left arrow key and change it to a minus sign. The screen will now look like
this:
DOSKEY HIDE=ATTRIB -H *.*
Next, use the left arrow again, and place the cursor on the first letter of
the word HIDE. The DOSKEY default editing mode is overstrike, and here you
want to insert the letters UN without writing over what's already there, so
press the Insert key to switch to insert editing mode. DOS will change the
cursor shape to indicate that you're no longer in overstrike mode. Type in
the two letters UN to yield this command:
DOSKEY UNHIDE=ATTRIB -H *.* and press the Enter key to finish the process and
enter the new command. You'll now have two macros at your disposal, HIDE and
UNHIDE. To have DOSKEY display all your macros, type
DOSKEY /MACROS
or
DOSKEY /M
You should see
HIDE=ATTRIB +H *.*
UNHIDE=ATTRIB -H *.*
To hide all the nonsystem files in your current directory, just type HIDE at
the DOS prompt. Then type DIR, and they won't appear. When you get back
from lunch, type UNHIDE to bring them back.
You could just as easily turn these two macros into batch files. In fact,
macros are sort of like crippled batch files that aren't permanent and don't
take up much disk space. Batch files are more powerful, allowing conditional
IF testing and jumps to labels. But macros have advantages in size and
speed.
Small files don't always take up small spaces on your disk. As mentioned
earlier, DOS divides the total space of a disk into pieces called clusters
(or allocation units) and slices all files into cluster-sized chunks.
Because the FAT has a limited number of entries, DOS adjusts the cluster size
depending on how large your disk is. If the disk is small, the clusters can
be as small as 512 bytes. On a large hard disk, however, you could end up
with clusters that are 4K or even 8K.
If you create a HIDE.BAT batch file that does the same thing as the HIDE
macro above, the directory listing will tell you that HIDE.BAT is only 13
bytes long. But since DOS stores files in cluster-sized chunks, HIDE.BAT
will take up a whole cluster of disk space. On a 1.44MB disk, with 512-byte
clusters, you end up wasting 499 bytes. But on a typical hard disk, with 4K
clusters, you'll waste 4,083 bytes. If you have lots of small batch files on
your disk you'll waste tons of disk space.
Macros also execute faster than batch files, since they're already loaded
into memory. When you tell DOS to run a batch file, it first has to figure
out where the file is stored, which often means hunting in every subdirectory
specified by your path, and then has to load it off a disk.
It would be a royal pain if you had to create all your macros each time you
booted, so DOS lets you load macros from inside a batch file. Ordinarily
this could be a problem, since macros can do many of the same jobs as batch
files, including redirecting input and output and using replaceable
parameters. But without a special way to identify such macro features, any
batch file that loaded macros could become confused. DOS might wonder if you
were trying to have the batch file redirect output, or if you were telling it
to create a macro that redirected output.
To allay confusion, DOS created five new macro command symbols that duplicate
batch file functions (see "DOS 5.0 Macro Operators" below).
It also created three new symbols:
$$: Since a single $ is the macro operator symbol, you
normally can't display a dollar sign in a macro. But
if you specify a pair of them, a macro will display a
single dollar sign.
$T: Command separator that lets you put several
different commands on the same macro line.
$*: Replaceable entire command tail that takes
everything typed in after the macro name and puts
it into one $* variable. The nearest batch file
equivalent would be to use %1 %2 %3 %4 %5, and
so on, except that batch files allow only nine
parameters and force you to use the SHIFT
command for more.
The $* is a welcome addition and offers something
that batch files can't do. If you type
DOSKEY ECHOALL=ECHO $*
you'll create a macro called ECHOALL that repeats everything you entered
after the name of the macro at the command line. Then type
ECHOALL a b c d e f g h i i k l m n o p q r s t
u v w x y z
and DOS will print out the whole alphabet. A batch file using %1 %2 %3, and
so on, could print out only the first nine letters on one line, although you
could create a batch file called ECHOALLB.BAT that printed them all, one to a
line:
@ECHO OFF
REM This is ECHOALLB.BAT
:TOP
IF %1!==! GOTO END
ECHO %1
SHIFT
GOTO TOP
:END
Notice that the ECHOALLB.BAT batch file and the ECHOALL macro have different
names. This is necessary because DOSKEY macros take precedence over
everything, including internal DOS commands.
A New Order
With the addition of the macro generator, DOS 5.0 changed the "order of
execution" of commands. In earlier versions, DOS would give top priority to
"internal" commands (ones like DIR and TYPE that are actually contained
inside COMMAND.COM), then to "external" programs in the current directory
with .COM extensions, then external programs in the current directory with
.EXE extensions, then batch files (with.BAT extensions), then.COM and.EXE and
batch files in your PATH. This meant that if you had a file called DIR.COM
or DIR.EXE or DIR.BAT on your disk DOS would never get around to running it,
since DOS would always give priority to the internal DIR command (although
you could trick DOS by asking it to run.\DIR-the single period is DOS
shorthand for the current directory).
However, DOS 5.0 executes macros even before it gets to internal commands, so
you can redefine DOS internal commands to enhance the way they work. This is
especially useful with a duplicate command like ERASE and DEL, since you can
keep one version the way DOS intended and customize the other version.
For example, if you have lots of room on your hard disk, you might want to
keep DEL as the traditional file expunger but change ERASE so that it copies
files to a \TRASH subdirectory and then deletes them from the current
directory, instead of wiping them off your disk. While DOS 5.0 offers an
UNDELETE utility, UNDELETE works best if you bring files back immediately
after erasing them and may not work at all on files erased long ago. Copying
files to a \TRASH subdirectory and deleting them from the current directory
will let you bring any file back at any later time (unless you happen to copy
two files with the same name into \TRASH).
To create the new ERASE macro, type
DOSKEY ERASE=COPY $1 \TRASH $T DEL $1
The $1 is a replaceable parameter that lets you specify which filename the
macro is supposed to move to \TRASH. The $T is a command separator that lets
you combine commands (one to make the copy, the other to delete the original)
on the same line. This macro is essentially the same as a TRASH.BAT batch
file:
ECHO F | XCOPY %0.BAT \TRASH\%O.BAT > NUL
COPY %1 \TRASH
DEL %1
(Important: If you try this you'll need the ECHO F XCOPY %.BAT \TRASH\%0.BAT
> NUL line because subdirectory names and filenames are so similar. The
ambiguous command
COPY WALLOPER.DOC \TRASH could mean copy the WALLOPER.DOC file to the \TRASH
subdirectory, or it could mean copy WALLOPER.DOC to the root directory and
rename it to TRASH. If you already have a \TRASH subdirectory, DOS will
assume that you want to do the former. However, if XCOPY doesn't find a
subdirectory called \TRASH, it will need to ask what you meant.
Fortunately, XCOPY will create a subdirectory if it thinks you need one and
the one you want doesn't happen to exist; the older COPY utility won't do
this. If you don't use this ECHO F ... line and you don't have a \TRASH
subdirectory, the ERASE macro won't work properly and will simply copy each
file to the root directory and rename it TRASH.)
Once you've created the ERASE macro, use it at the DOS prompt by entering the
word ERASE followed by the name of the file you want to move to the \TRASH
subdirectory. To get rid of a file for good, type
DEL WALLOPER.DOC
But to move the file safely to your dumping area, type
ERASE WALLOPER.DOC
While you're at it, create a macro called UNERASE that brings the files back:
DOSKEY UNERASE=COPY \TRASH\$1
When you start to create macros, you'll want to find a painless way to load
them into memory each time you boot up. You could simply create an MLOAD.BAT
file that loads everything each time:
@ECHO OFF
REM This is MLOAD and assumes DOSKEY is already
loaded
REM The next line creates a \TRASH directory if
necessary
REM (\TRASH is needed only for ERASE and
UNERASE below)
ECHO F | XCOPY %0.BAT \TRASH\%0.BAT > NUL
DOSKEY HIDE=ATTRIB H *.*
DOSKEY UNHIDE=ATTRIB -H *.*
DOSKEY ERASE=COPY $1 \TRASH $T DEL $1
DOSKEY UNERASE=COPY \TRASH\$1
However, it's easy to create MACLOAD.BAT and UNLOAD.BAT batch files that can
load (and unload) macros selectively. To work properly, MACLOAD.BAT and
UNLOAD.BAT need a tiny new program called SNIFF.COM. You can use the longer
version described earlier (which screens out everything except the digits 1
through 5, and the letters A, B, Y, and N), or you can create the abbreviated
version below.
To create this abbreviated version, use a pure ASCII word processor to type
in the following script file, called
SNIFF.SCR:
E 100 B4 00 CD 16 24 5F B4 4C CD 21 C3
N SNIFF.COM
RCX
B
w
Q
Be sure to leave an extra blank line after the final Q. To create SNIFF.COM,
make sure DEBUG.COM is handy and type
DEBUG < SNIFF.SCR
The sample MACLOAD.BAT that follows loads the
four macros mentioned above; substitute your own:
@ECHO OFF
REM This is MACLOAD and assumes DOSKEY is
already loaded
REM The next line creates a \TRASH directory if
necessary
REM \TRASH is needed for ERASE below)
ECHO F | XCOPY %0.BAT \TRASH\%0.BAT > NUL
ECHO Want to load HIDE (Y/N)?
SNIFF
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 DOSKEY
HIDE=ATTRIB +H *.*
ECHO Want to load UNHIDE (Y/N)?
SNIFF
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 DOSKEY
UNHIDE=ATTRIB -H *.*
ECHO Want to load ERASE (Y/N)?
ECHO (This moves files to a TRASH directory
instead of deleting them)
SNIFF
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 DOSKEY
ERASE=COPY $1 \TRASH $T DEL $1
ECHO Want to load UNERASE (Y/N)?
ECHO (This brings back files from a TRASH
directory)
SNIFF
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 DOSKEY
UNERASE=COPY \TRASH\$1
CLS
ECHO =======================
ECHO List of current macros:
DOSKEY /M
You can remove all your macros in one gulp by typing Alt-F10 at the DOS
command line, or you can remove them individually by leaving the right side
of the equal sign blank. So, to remove HIDE as a macro, type
DOSKEY HIDE=
You could also run the UNLOAD.BAT batch file below to remove macros
interactively. Again, substitute your own in place of the four shown here:
@ECHO OFF
REM This is UNLOAD and gets rid of DOSKEY
macros loaded by MACLOAD
REM It assumes DOSKEY is already loaded
ECHO =======================
ECHO List of current macros:
DOSKEY /M
ECHO =======================
ECHO Want to unload HIDE (Y/N)?
SNIFF
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 DOSKEY
HIDE=
ECHO Want to unload UNHIDE (Y/N)?
SNIFF
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 DOSKEY
UNHIDE=
ECHO Want to unload ERASE Y/N)?
SNIFF
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 DOSKEY
ERASE=
ECHO Want to load UNERASE (Y/N)?
SNIFF
IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 DOSKEY
UNERASE=
CLS
ECHO ======================
ECHO List of current macros:
DOSKEY /M
Once you've used DOSKEY to redefine an existing DOS command, you have the
option of running the new customized command or the old one. To run the new
macro version, make sure the first letter of the command is right next to
the DOS prompt, with no intervening blank spaces. To run the original, add a
space or two. So if you redefined ERASE, and your prompt is created by $P$G
(so the C: root directory looks like C:\>),
C: \>ERASE
will run the macro version, and
C:\> ERASE
will run the old, original DOS command.
Command-Line Collector
DOSKEY's other talent is to "stack" commands in memory so you can recall (and
edit) them later. While previous DOS versions let you recall just the one
previous command by pressing F3, DOSKEY can remember virtually every command
you typed (see "DOSKEY Command Stacker Quick Reference," page 178).
DOSKEY stores these commands in a FIFO (first-in, first-out) buffer, so that
when it fills up, the newest commands start to kick the oldest ones out. The
default buffer size is 512 bytes, but you can shrink it to 256 bytes to save
memory, or beef it up to hold lots more.
Just as you could list all the macros by typing DOSKEY /M, you can also list
all the stacked commands by typing
DOSKEY /HISTORY
or
DOSKEY /H
If you really want to see all your previous commands, it's better to use F7;
doing so will pause the screen if it fills up and number the commands.
However, DOSKEY /H (and DOSKEY /M) are very useful because they let you
redirect the lists of stacked commands and current macros into DOS files that
you can later edit.
Typing DOSKEY /H > LOGFILE lets you maintain a log of everything you did all
day long (assuming the buffer was big enough). And DOSKEY /H > RAW.BAT lets
you create batch files on the fly by redirecting previous commands into a
file and then using a pure ASCII word processor, or the new EDIT text editor,
or even EDLIN to weed out the lines you don't want and correct the ones you
do.
Similarly, typing DOSKEY /M > MACROMAK.BAT creates a file that you can use to
generate all your macros. Just use an editing program to stick the word
DOSKEY at the start of each fine, and run the batch file. Trick or Tweak
Microsoft enhanced several other commands slightly. Beginning with Version
3.3, BACKUP has offered the ability to format backup disks on the fly (so
long as it could find DOS FORMAT). With Version 3.3 you needed to tack on a
/F to do so. Version 4.0 didn't need the switch, but it could get confused
by the wrong-capacity disk. Version 5.0 lets you specify what size disk you
want it to format, with the same IF switch used by FORMAT. But BACKUP is
still such a poor performer that you should probably buy a commercial backup
utility.
BACKUP's complementary RESTORE program can now display the files on backup
disks if you use a RESTORE /D command, although the required DOS syntax makes
you enter a target disk as if you were actually going to restore the files.
The new 5.0 KEYB command can now understand enhanced keyboards, but you
probably don't need it. ANSI.SYS now comes with a /SCREENSIZE (or /S) switch
that lets you set up your display at boot-up the way you want without having
to enter MODE commands. Unfortunately, Microsoft provided no online help for
ANSI, which is one of the DOS files that needs it most. And a few new
commands and environment variables let you tell DOS where you've pigeonholed
various files that it needs (EMM386.EXE, WINA20.386, DOSSHELL.INI). One
undocumented addition is that VE R /R now prints out some additional
information.
The two remaining big deals-the QBASIC interpreter and the EDIT text
editor-are crippled versions of existing Microsoft products.
IBM's original PC came with a dialect of the BASIC programming language on a
32K ROM inside the machine. In fact, if you turned on the system without a
disk in it, a puny version of BASIC appeared onscreen. IBM thought users
would store programs on cassettes and included a MOTOR command to turn tape
recorder motors on and off. Running this command toggled an internal
mechanical relay, and the only real use for it was that programmers
discovered that by repeating the command very fast they could make the relay
vibrate frantically and simulate an engine sound.
IBM distributed three versions of BASIC back then-cassette BASIC on a ROM, a
version called Disk BASIC that needed 32K of RAM and could save files on
disks, and a top-of-the-line version called Advanced BASIC "BASICA!') that
needed 48K of RAM and could do primitive dot-addressable graphics and play
music.
Actually, BASICA wasn't so bad. Although it couldn't handle programs larger
than 64K and was fairly slow, it provided a simple but powerful set of
commands that taught a generation the programming fundamentals and got them
hooked on taking control of their systems.
Because the top people at Microsoft understand how important a programming
language like BASIC can be, BASIC will keep getting better and better. Rumor
is that an easy version of it will become much more important as a primary
operating system tool in the future.
Over the years, Microsoft and its archrival Borland have transformed BASIC
from a teaching tool into a serious programming environment. They've added
power and speed, sophisticated debugging tools, and decent support. The old
IBM versions were interpretive, which meant that BASIC ran programs by
reading and executing them one line at a time. Each line of the program had
to be numbered sequentially. Programs wouldn't run unless a copy of BASIC
itself was handy. Serious programmers, some of whom had cut their teeth on
BASIC, sneered at this "kiddie" language.
Several years ago both Microsoft and Borland beefed up the commands, added
debuggers, and released BASIC packages that offered compilers. A compiler
can read in a whole program and after a step or two spit out an
"executable".EXE file that doesn't need the original copy of BASIC to work.
Compiled BASIC programs could be large, and they were fast and flexible.
Commercial applications from games to accounting packages were written in it.
The DOS 5.0 package includes an interpretive version of Microsoft's powerful
QuickBASIC programming environment, with menus, help, mouse support, and
solid debugging aids. If you remember BASIC as something that required line
numbers and was useful only to plink out "Happy Birthday," you're in for a
surprise. Microsoft hopes this friendly and capable new version mill help
sell DOS 5.0, provide a far better tool than GWBASIC and BASICA for weekend
programmers, and act as a demo for its separate QuickBASIC compiler.
Microsoft included an interesting handful of sample programs on the disk.
One is a personal finance money manager that calculates your net worth.
Another removes line numbers from old BASIC programs. The other two are
games. The instructions for one begin "Navigate your snakes around the game
board . . ." But trust us, BASIC is a serious language.
The other sample BASIC program used to be called CASTLE and would let two
players at opposite ends of a mountain range fire artillery pieces at each
other. That was before the Gulf War. Now, Microsoft supplies a very similar
program called Gorilla, which lets two gorillas at opposite ends of a city
skyline throw exploding bananas at each other. Sociologists take note.
The final DOS 5.0 addition is EDIT, a full-screen ASCII text file editor that
looks surprisingly similar to the QBASIC program editor. In fact, it is the
QBASIC program editor. Run it on a disk by itself, and you'll get a "Cannot
find file QBASIC.EXE" error message.
The only text editor DOS provided in previous versions was EDLIN, one of the
most reviled programs of all time. It looked like something that an angry,
antisocial Unix programmer whipped together in one evening to finish an
emergency job when his normal word processor started acting flaky. EDLIN
uses 13 semi-inscrutable single-letter commands in a sort of reversePolish
notation, with the operator at the end. Some are utterly baffling, like the
Replace command, which forces you to insert a Ctrl-Z halfway through it.
EDIT is vastly better. While EDLIN lets you work on only one line at a time,
EDIT lets you go anywhere on the screen and use a mouse. It provides brief
but decent help screens, letting you bounce around from one to another and
back again (stacking as many as 20). It recognizes standard Microsoft
application and WordStar key commands, comes with a clipboard, and lets you
cut and paste. It works on screens with more than 25 lines and makes it easy
to move around the file (even scrolling right to left). You can set tabs,
resize windows, turn scroll bars on and off, change the colors, enter
high-bit characters, search and replace with the options of ignoring case or
looking for whole words only, and even keep four WordStar-like ^ K1/ ^ Q1
bookmarks.
It can handle files up to 32,700 lines in length, which should be enough for
your CONFIG.SYS and AUTOEXEC.BAT files. And while it can print, it can't
format, set margins, or wrap lines. After all, it's a program editor, not a
word processor. But the price is right, and anyone can figure out how to use
it.
The new EDIT command, the help facility, the Shell, and the updated manuals
are all OK, and compared to previous incarnations they're vastly improved.
But they're also all a bit rough around the edges. There's nothing patently
wrong with any of them, but somehow you expect more from the monolith of the
industry.
Making the Upgrade
As you read this, the bean-counters on Wall Street are probably thinking
about how many users are going to upgrade and are licking their chops in
anticipation. Virtually nobody bought Version 4.0. Virtually everyone wants
more memory space. Almost every Windows 3.0 user needs DOS 5.0 to make it
work right. Microsoft claims there's something in this package for everyone,
and they have a point.
* Klutzes and DOS-haters may take to the Shell, which will let them do
Mac-like icon dragging and mouse operations. They'll definitely benefit from
the fail-safe MIRROR file protection and the easier installation.
* Experienced users will like the online syntax assistance, the DOSKEY
command-stacking and macro abilities, the beefed-up DIR and ATTRIB power, the
ability to get around version-checking software, and the better editor and
manuals.
* Sloppy commercial applications programmers will be relieved that they can
now release products that are even flabbier and packed with even more useless
features (Octal Margin Settings! VIC 20 Emulation! Background Stochastic
Matrix Calculators! 3-D Shadow-Type Error Messages) and written by even
bigger committees.
* MIS types will appreciate the ease of installation over a network and will
be relieved that DOS, network software, applications, and data can now fit
together with only a little anguish.
* Laptop users will soon be able to use a ROM-based version with enhanced
power-management features (where better to hit the sleep switch than from the
DOS kernel itself'.?).
* Windows users will get an immediate performance boost.
* Everybody will breath a sigh of relief that the industry cain finally
standardize on a new version, especially one that ends in 0.
Most users, especially those with 386 or 486 systems, should bite the bullet
and buy Version 5.0. Microsoft is making the upgrade price attractive
($99.95 list) and even--gasp--selling it direct.
Everybody wins. You get more RAM and more power. Novices get a Shell they
may actually use. The channel gets a hot new product. Application vendors
get a chance to exploit new memory niches. DOS tinkerers get a macro
generator and a new BASIC. And Microsoft will probably clean up.
How to Upgrade
Look for the MS-DOS 5 Upgrade at all retail outlets and mail-order houses
that carry Microsoft products, including Egghead Discount Software, Dustin,
ComputerLand, and other notional chains. The list price for the upgrade is
$99.95; look for discounts at these reseller outlets.
You can also purchase the MS-DOS 5 Upgrade directly from Microsoft by calling
the MS-DOS information line (800-992-3675), but expect to shell out the full
price. The full DOS 5.0 package is only available through OEMS. if you buy
a copy when you purchase a new computer, the price of the software is
determined by the dealer/manufacturer