Keep DOS in line. (improving the operation of MS-DOS) (Column)
by Tony Roberts
Sometimes it's easy to overlook the little things. Somehow the big picture keeps getting in the way. Here's a list of little things you can do to make DOS work better.
What was that switch again? Don't forget DOS 5.0's help feature when the syntax for a seldom-used command escapes you. Just enter either help for a list of subjects on which help is available or help command, filling in the name of the command for which you need extra information.
Where did that file go? DOS 5.0's enhanced Dir command can be used as a file finder. The /s switch, when added to a directory command, will build a directory for the current subdirectory and all of its children. To search your whole hard disk for that missing file, use a command such as Dir README.TXT /s. Wildcards work, too. Try Dir MYFILE*.* /s, for example, to find any file with any extension that begins with the characters myfile.
Hey! Where am I? It's easy to get lost in the subdirectory structure of a large hard drive, but it's also easy to teach the DOS prompt to provide a You Are Here pointer. Just add the line prompt $P$G to your AUTOEXEC.BAT file. This will display the current path as the system prompt, so you'll always know which subdirectory is current.
Kick that keyboard into high gear! The DOS Mode command provides a way to control the typematic rate of the keyboard--the rate at which DOS repeats a character when you hold down the key for that character. The command Mode con:rate=32 delay=1 will give you the fastest rate possible. Add it to your AUTOEXEC.BAT and watch your cursor fly. In the unlikely event that this setting is too fast, reduce the rate and increase the delay (up to a maximum of 4) until you find a setting that suits you.
Make your hard disk brush and dfFloss daily. Preventative maintenance is good for your teeth, and it's good for your hard disk as well. Run Chkdsk or another disk-repair utility at least once a day and clean up any file allocation problems or lost clusters. This keeps the disk's road map to your files clear and easy to read. Always perform a disk check after a system crash or lockup because file damage is most likely to occur when programs can't exit normally.
Verify that Copy. Have you ever copied a file to a floppy disk for a friend or co-worker only to learn later that the file couldn't be read on his machine? If you want to be sure you've saved a good copy, turn on DOS's verify feature with the command Verify on. If verify is on, DOS will write the file to the floppy disk and then read it back and compare it to the copy on the hard disk to ensure that the data was saved correctly. Using Verify takes a little longer, but the extra few seconds is worth it. Use Verify off after you've finished with the copy, or your system will verify every file write. To see whether Verify is on or off, type verify at the DOS prom pt.
Directory style default. If you have DOS 5.0, you have a Dir command with lots of switches to customize your directory listings. You can specify sort order, group subdirectories first, display files based on attribute settings, and display directories in upper- or lowercase letters. Once you've figured out which directory settings you use most of the time, make those commands your default by setting an environment variable called DIRCMD. Do this in your AUTOEXEC.BAT file. I use the command Set DIRCMD=/I/ogn to display directory information in lowercase ordered by name with subdirectories listed first.
Quicker than Copy. If you're copying several files to and from floppy disks, save time by using Xcopy rather than Copy. When copying multiple files, Copy reads one file from the source disk and then writes it to the target. But Xcopy reads as many of the files as possible into memory; then it writes them all out in one operation.
Buckle up for safety. If you've been uninspired by the Mirror command, reevaluate the situation. Mirror is like a seat belt: When everything's going smoothly, it doesn't do much, but when there's trouble, it can make all the difference. Mirror saves copies of your system's file allocation table, which the Undelete and Unformat commands can use as reference points if the need arises. I recommend running Mirror on each of your hard drive partitions from commands within your AUTOEXEC.BAT.
See the difference. Have you ever wondered what the difference is among the files on your disk named AUTOEXEC.BAT, AUTOEXEC.BAK, AUTOEXEC.000, and AUTOEXEC.SYD? An easy way to compare text files is with the FC command. FC is a DOS file-compare utility that doesn't seem too helpful until you figure out that you need to use the /l, /c, and /n switches with it. The switches indicate that you're doing an ASCII compare (/l), you're not concerned about the characters' case in the files (/c), and you want line-number references included in the output (/n). For example, enter fc /l /c /n autoexec. bat autoexec.bak; any differences in the files will be displayed.