Classic Computer Magazine Archive COMPUTE! ISSUE 137 / JANUARY 1992 / PAGE S24

19 top DOS 5.0 tips. (MS-DOS Featuring DOS 5.0)
by Mark Minasi

DOS 5.0 is such a treasure trove of goodies that it will probably be years before we find out all of the good stuff that's in it. Here are just some of the things that I've figured out in the brief time I've worked with DOS 5.0.

1 Take the time to learn DIR's new options.

DIR gets the prize for most improved command under DOS 5.0. You can finally see the hidden files in your directory with the DIR/AH command.

I often use DIR /OS, which orders the directory by size. It arranges files from small to large, so I can immediately see the biggest files in the directory. That's useful when I need to free up some space on my hard disk; I can then identify which files will return the most space when erased.

And DIR /AD just shows me the subdirectories, something I previously had to do with DIR *. (and it didn't work for subdirectories with extensions in their names).

Go back to the DOS manual and study the options for the DIR command. I'll be using DIR a lot in my other tips. And if you find a set of options that you like, you can set them with an environment variable called DIRCMD. Suppose you always want to see your files sorted by file size; just add this line to your AUTOEXEC.BAT.

SET DIRCMD=/OS

And DIR will always sort by size, unless you tell it to do otherwise.

2 Use DIR to preview file sizes when copying files to a disk.

Many times, I've had to get a subdirectory's worth of data onto floppies. You can't just use COPY *.* if the files won't all fit on a single floppy. So I like to see if I can put just the COM files on one floppy, the EXE files on another, and so on.

I often need to know how many K of COM files I have in a particular subdirectory. With DOS 5.0, that's easy; I just type DIR *.COM. At the end of the listing, DIR tells me the total size of the files. Better yet, I can write a DOSKEY macro to give me just the size.

DOSKEY SIZE=DIR $1$2$3$B FIND "file(s)"

Then I just type SIZE *.EXE and it reports the sum of all the EXE files.

3 Create a small RAM disk and SET TEMP to that drive.

DOS's redirection and piping facility has always sounded nice, but it wasn't so good when you actually used it, as any pipes were rendered as temporary disk files. The relatively slow speed of disks made pipes and redirection impractical.

Under DOS 5.0, however, DOS can put the temporary pipe files anywhere you specify with the SET TEMP command. Create a RAM drive of, say, 128K, and let's say that the system assigns it a drive letter of E:.

Just use SET TEMP=E:\ and all of your pipe operations will go through a RAM disk running at full memory speed, which makes pipes and redirection much snappier.

4 Use the 43- and 50-line modes to get the most out of your EGA or VGA screen.

If you've loaded ANSI.SYS, the MODE command will allow you to view 43 or 50 lines on a screen with the MODE CO80,43 or MODE CO80,50 commands. You get smaller--but still quite readable--lines on your screen, allowing you to see more with your text editor, spreadsheet, or whatever. Hey, you paid for that VGA--get the maximum use out of it! (Not every application can use the extra line modes.)

5 Keep your logical drives under 128MB in size.

If you're lucky enough to have a hard disk drive larger than 128MB in size, you'll probably be happy to hear that DOS 5.0 doesn't have DOS 3.3's 32MB maximum disk size. DOS 5.0 can actually format drives with sizes up to 516MB.

Even though that's the case, however, I recommend that you divide a big drive into logical drives no larger than 127MB. The reason for this is cluster sizes.

Clusters are the minimum space allocation unit under DOS; no matter how small a file is, it's allocated a minimum of one cluster of disk space. Clusters are ordinarily 2K in size on most hard disks, so a ten-byte file really takes up 2K. Although the first ten bytes is the only data that counts in this file, DOS must allocate an entire 2K for the file.

If this sounds inefficient, it is, in some ways, and was one of the motivating factors behind the High Performance File System under OS/2 and in the new file system that will appear under DOS 6.0. Under DOS 5.0, however, clusters remain with us.

A logical drive larger than 127MB, however, has a cluster size of 4K--even more inefficient! So if you've bought a clone with one of those inexpensive Conner 212MB drives, don't format it as a single C: drive. Chop it up into 127MB for C: and 85MB for D:.

6 Speed up you keyboard with MODE.

If you have a 286, 386, or 486 computer, MODE can make your keyboard more responsive. Just type MODE CON: RATE=32 DELAY=1. Then the keyboard will autorepeat faster, as well as respond to keystrokes faster.

7 If your PC is slower than 10 MHz, rerun your interleave tests.

If you're like many PC users, you've run a program such as SpinRite, Disk Technician, Optune, or any of a host of others that can determine the optimal interleave factor for your hard disk--that is, the arrangement of data on your hard disk that allows the fastest access to that data.

DOS 5.0, however, slows some I/O operations down by a hair, causing the optimal interleave value to change a bit for some computers

For example, the optimal interleave for an IBM AT--an 8-MHz computer--is 1:2 on DOS 4.01 and earlier, but 1:3 on DOS 5.0. (Thanks to my co-worker Rob Oreglia for that tip.)

Learn how to unhide system files.

The DOS 5.0 ATTRIB command can now hide and unhide files.

But if you try to unhide the system files (MSDOS.SYS, IO.SYS, IBMBIO.COM, or IBMDOS.COM), you'll get a message such as not resetting attributes for system file XXXXX.XXX, where XXXXX.XXX is the file you wanted to unhide.

The reason is simple: ATTRIB will not unhide read-only or system files. The answer is to remove the read-only, system, and hidden attributes all in one fell swoop.

ATTRIB -R -H -S FILENAME.EXT

Then it won't complain.

9 Tighten up your STACKS, FCBS, and LASTDRIVE.

Most machines work fine with a CONFIG.SYS setting of STACKS=0,0. This may actually reduce unrecoverable applications error under Windows.

Set LASTDRIVE=F or G or whatever your last-used drive letter is, and save about 100 bytes per drive letter. FCBS is a leftover from DOS 1.0. I set my FCBS=1 and save a few bytes.

10 If you use PC-DOS, use the file compare command.

MS-DOS users have had FC, the file compare command, since MS-DOS 2.11. Now it's finally included with PC-DOS. FC is an intelligent file comparison program, one that compares files line by line, detecting deleted and inserted lines.

I've used it regularly for years, by moving FC from my copies of MS-DOS to my computers running PC-DOS. It's nice to finally see it included with PC-DOS 5.0.

11 Use ERASE /P to help you clean out unwanted files from your hard drive's directories.

Erase now has the /P prompt option. Try typing ERASE *.* /P, and ERASE will prompt you with each file's name, as in erase BANANA.COM Y/N? I've found it the quickest way to clean out a directory when you want to save some files, want to eras some others, and can't use a wildcard erase.

12 Compared to other versions, DOS 5.0 is less picky about what it needs to boot.

Previous versions of DOS needed the hidden files right at the top of the root directory, and the files had to be in the first few clusters. All DOS 5.0 requires is that the files be somewhere in the root directory--which is one reason why it's so easy to install DOS 5.0 on a machine that's already running DOS.

13 Use DELOLDOS to free up additional space.

If you're sure you like DOS 5.0--and most of us are--then get rid of the old version of DOS that's still on your disk. Huh?

That's right, DOS 5.0 keeps your old DOS on the hard disk, just in case you want to uninstall DOS 5.0 and return to your old DOS. A nice touch, but I'm sold on 5.0. I don't need the old DOS around.

Just type DELOLDOS, and DOS 5.0 will erase the remaining parts of your old version of DOS, freeing up some hard disk space.

14 Make a bootable floppy.

The DOS 5.0 that most of you bought was only an upgrade kit; none of the DOS 5.0 distribution disks are bootable.

That means that if your hard disk won't boot for some reason, you won't have a floppy to boot from in case of an emergency. So make a bootable floppy now, while you're thinking about it. It's easy--just type FORMAT A:/S.

15 Use GRAPHICS even if you don't have an Epson printer.

The GRAPHICS program, which has been around for quite a while, allows you to use the Print Screen key from a graphic screen. Until now, however, it only worked with Epson or IBM dotmatrix printers. As of DOS 5.0, Hewlett-Packard printers are also supported.

16 Use CHKDSK to find out which files are noncontiguous.

Although CHKDSK has done it since DOS version 2.0, most people don't seem to know that this DOS utility can scan a subdirectory for noncontiguous files.

Just type CHKDSK *.*, and you'll see the usual CHKDSK output followed by a listing of the names of the noncontiguous files or the message all files are contiguouts.

17 If a program won't load high, try running DOS low.

As you've probably seen by now, not every program will load high with the LOADHIGH or DEVICEHIGH statements. Y ou may be tempted to play with the EMM386 memory manager settings to try to fix this--but don't. An easier test is to change your CONFIG.SYS's DOS statement from DOS=HIGH,UMB to DOS=LOW,UMB. Then reboot and see if the problem is cleared up.

18 Don't use SMARTDRV.SYS.

Yes, it's free, but SMARTDRV isn't too bright (perhaps DUMBDRV.SYS would be a better name). It can actually slow you down if you've got a drive that does something called sector translation. This is basically a drive that doesn't tell the system the whole truth about itself. For example, a sector-translating drive with 2000 cylinders and two disk heads may tell DOS that it actually has only 1000 cylinders and four heads. Why would it do this? Briefly, PCs can't address more than 1023 cylinders on a hard disk. Such a drive could actually be slowed down by SMARTDRV. My suggestion is to get a copy of PC-Kwik Cache from Multisoft in Beaverton, Oregon. I've used PC-Kwik for years and have found it to be fast, bug-free, and reliable.

19 If you don't need expanded memory, don't set up EMM386 for it.

The DOS 5.0 memory manager does two main things. It creates and fills UMBs, and it creates and manages expanded memory. Expanded or LIM memory is used by some DOS programs--but not most. If you decide to allow EMM386 to create expanded memory with the RAM option, EMM386 will use up 64K of your upper memory space with something called an EMS page frame. That's 64K that you could be using for TSRs and device drivers, so if you don't need expanded memory, use the NOEMS option with EMM386. You'll also free up some extra memory for Windows.