The magazine of the Melbourne PC User Group

Beginners' Bytes: Part 7
Ron Wilby

Welcome again to all you beginners and to all the experts among our readers. Do not read this month's "Beginner's Tale" and the continuing troubles fm having. I don't want you to see how difficult PC ownership can be. Read instead the frolics of Tessa, Dave et al with the BBS, they are having fun while I can't even get the damn thing to boot.

The Start Up Files, CONFIG.SYS and AUTOEXEC.BAT

These two files strike terror into many hearts, especially mine when I was a Beginner. Even our President, Charles Wright, has expressed in the Green Guide his misgivings about CONFIG.SYS. In my early days I was too scared to have anything to do with these files, so let me tell you what I've since learned.

That most helpful SIG convener and Dial Helper, Doug Brooke, has provided a 3-page document on these files and I am indebted to Doug for much of this month's instalment of Beginners' Bytes.

When you switch on your PC your processor looks at a simple program stored permanently in ROM (Read Only Memory). Unknown to you it then goes through a series of boot programs, the last of which looks for a file named CONFIG.SYS. If that file is found, any instructions it contains are carried out. Control is then handed over to COMMAND.COM, the command interpreter, which then searches the root directory of your boot disk for a file named AUTOEXEC.BAT. If found, the commands in AUTOEXEC.BAT are executed one after another. Depending on what is in this file, you will then see the DOS prompt or perhaps your DOS shell menu or even your favourite program's opening screen. These "Startup Files" are not essential. You can start up without them, but they make it possible for you to have your PC operate exactly as you want it. Thus, everyone will have different versions of these files. You can create them and alter them as you wish. Here's how...

Creating the Startup Files

These files are simply lists of commands which you want carried out as your computer starts up. As both are simple text files they can be created with any word processor (be sure to use non-document mode or ASCII or whatever your word processor calls the plain text mode). I recommend you use DOS Editor if you have DOS 5 or 6. Brave souls with earlier DOS versions can use Edlin. Put each command on a separate line and be very careful to get punctuation etc. exactly right. Copy both these files into the root directory of your hard disk by issuing the command

COPY CONFIG.SYS C:\

or

COPY AUTOEXEC.BAT C:\

Protecting Your Startup Files

I know you won't have time to read this if you have just got home with a new program, but you can read it before your second attempt at installation.

The installation programs which come with some Applications may modify your Startup Files. Lots of people don't like this (I don't) and make their Startup Files read only, but that may lead to incorrect installation. My advice is to make copies of your CONFIG.SYS and AUTOEXEC.BAT in a different directory or on a floppy disk. It can be a long and tedious job restoring your lost startup files after some program has been at them. Some programs save your files under names like CONFIG.OLD and thus avoid the need to make copies. Check the Manual to see whether you are safe here.

CONFIG.SYS

This file configures (sets up) the computer system to function the way you want it to be. It is read by DOS only at startup, so if you change this file, you must reboot for your changes to take effect. If DOS cannot find a CONFIG.SYS file, then there are default values which DOS will use because you haven't specified anything different. CONFIG.SYS may contain configuration commands only. There are fifteen of these listed in your DOS 5 Manual. What are they?

Allowable Commands

Some typical commands are:

FILES=nn (nn is a number). Sets the number of files which can be open at the same time. The default value is 8, but this is not enough for today's programs. The maximum number you can have open is 255, but a more common value is 30 or 40. Too many files open will use valuable memory so check your software manuals.

BUFFERS=nn sets the number of small memory blocks (512 bytes) that DOS can use as storage when reading or writing to or from disk. Too few buffers will slow your system, again check the manuals of your Applications programs to see what is needed.

BREAK=ON enables Ctrl+C to immediately terminate any operation. The default setting is OFF.

Device Drivers

There are a number of these which come with DOS, depending on your version. My CONFIG.SYS has the device drivers HIMEM.SYS, EMM386.EXE and ANSI.SYS as well as instructions to load them all into high memory. Thus my CONFIG.SYS allows me about 614 kB of conventional memory, and DOS allocates my other memory as required. Also, mouse drivers would appear here. You put a line like

DEVICE=ANSI.SYS

or

DEVICEHIGH=ANSI.SYS

in your CONFIG.SYS to make DOS load that device ready for you to use after your system boots up. DEVICEHIGH simply loads the device driver into high memory instead of conventional memory. For more discussion of memory read Tom Coleman's piece in PC Update, March 1994. A line for COUNTRY enables DOS to use the appropriate time, date and currency conventions. I have

COUNTRY=061„ C:\DOS\COUNTRY.SYS

which puts my dates and times in Australian format (dd,mm,yy). Doug Brooke has an interesting line which reads:

SHELL=C:\COMMAND.COM /P /E:320 /F

Doug comments, "The line prevents lockup if DOS cannot find the command processor. It also increases the environment from the default 160 bytes to 320 to cater for a long Path statement or a Backups complicated prompt. The environment is a space where DOS stores environment variables such as path, prompt and other values using the SET command. The / F (undocumented DOS command) overcomes the long delays when you try to log on to a floppy drive containing no disk."

So your CONFIG.SYS file might look like this
files=30 
buffers=30 
country=061,,c:\dos\country.sys
(yes two commas after 061) 
break=on 
device=c:\dos\ansi.sys

One more command you will find very useful, although it isn't really a command. You put REM at the beginning of any line of your startup files. When DOS sees rem, it treats that line as a "descriptive comment" and takes no action. Thus, if you think the line that you just added to CONFIG.SYS or AUTOEXEC.BAT is creating a problem, don't delete it, it's quicker to REM it to see whether that cures the trouble.

AUTOEXEC.BAT

After carrying out your instructions from CONFIG.SYS, the boot program hands over control to COMMAND.COM, which searches the boot disk, trying drive A: first then if unsuccessful drive C: looking for a file called AUTOEXEC.BAT. If found, the instructions in this file are carried out one after another. Typical commands could be:

PATH. Tells DOS which drives to search. Separate the directory names by a semicolon.

PROMPT. The style, colour and placement of the prompt can be customised as you wish. See PC Update March 1993 for a masterpiece of PROMPT construction from Doug Brooke. Looks interesting, must try it myself.

SET. Installation of software often leads to SET commands being put in AUTOEXEC.BAT. For example I have one from Grammatik and one from PC Tools as well as some lines from DOS.

Application programs can be called up, so that your computer always starts up with, for example, the opening menu of your word processor or whichever program you use most frequently. My AUTOEXEC.BAT is:

SET GMKS=C:\GMK
echo off 
SET PCTOOLS=C:\PCTOOLS\DATA
cls 
prompt=$e[32;40m$p$g
path c:;c:\dos;c:\ws6;c:\123
BREAK=ON MIRROR /TC
LOADHIGH C:\DOS\UNDELETE/TC
menu
(put there by Grammatik)

(from PC Tools) 

(look in your DOS manual for this one
(and many more directories)
(from DOS) 
(puts UNDELETE in high memory)

The last line brings up a menu program from which I can easily select an Application.

Note that DOS does not distinguish between upper and lower case letters in commands, hence the mixture.

Backups

In my early days, as soon as I got my first hard disk, I heard muttering about backups and viruses. When I enquired about backups I was told to save the file I had been working on to a floppy disk, so that I had a backup copy in case of disaster. Of course, I soon had many, many floppies with copies of files everywhere, but ignorance is bliss and floppies are cheap, so why worry, I thought.

Virus Attack

Then disaster struck!! Some helpful friend gave me a disk with a copy of something and suddenly error messages like

General failure Drive C
Not ready Drive C


began to appear. I was having difficulty accessing my hard disk, Drive C:. Sometimes I could get in there, but when I wanted to save my work, I got mysterious "disk full" messages. Not very helpful when you have been typing for two hours and can't save the work.

By this time I had two sets of backup floppies, but they were no help (I later found they were all infected with the virus). Finally a friendly local dealer diagnosed my problem, but the only cure was to format the hard disk, thereby losing everything on it. Because I was using only legal software, I had the original program disks that I had bought, but all my data in various files were gone. The only ray of sunshine was that I discovered it was possible to print this data, so it wasn't lost entirely, but there was lots of hard work needed to recover from this disaster. I now had to think about virus protection.

Virus Protection

Some years ago I wrote some software reviews for PC Update. Two of them were virus protection programs. I even had Peter Smith arriving on my doorstep with a floppy containing viruses. I think he wanted me to put them on my computer and then, he hoped, kill them off with the programs under review. Brrr! I tried it with just one virus, which was duly exterminated and I wasn't brave enough to try any more. These virus protection programs work in two ways. One depends on recognition of the virus and then preventing its spread prior to its destruction. This type of program of course needs continual updating as new viruses appear all the time and you can be caught by a new one. The other depends on the recognition of "virus-like activity," an approach that may not always work, I fear. In one of those reviews I wrote that your only complete protection against viruses is backups. If you have an uncontaminated backup, you can always format your hard disk and reconstruct your files completely. I keep Macaffee's SCAN and CLEAN UP programs (obtainable from our Shareware library) handy and scan any new disks that arrive from wherever. Be especially careful with children's games and have nothing to do with disks that have been anywhere near University or College campuses. Fortunately I've never had to use CLEANUP.

That's all for this month, dear readers. Next month maybe we can talk about backups. Till then . . .

Reprinted from the April 1994 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[About Melbourne PC User Group]