Managing A PC

Managing A Personal Computer

1.1 The AUTOEXEC.BAT file is one of files which loads every time the computer is booted. It contains command lines and procedures to run programs and load settings for the systemís hardware and software configuration. It also may contain command lines procedures to run programs which may clean your systemís hard drive of temporary files and viruses.

An example of this file is shown below:

@ECHO OFF
PROMPT $P$G
SET PATH=C:DOS
LH C:SBCDDRVMSCDEX.EXE /S /D:MSCD001 /M:8 /V
SET BLASTER=A220 I5 D1 T4
SET SOUND=C:SBPRO
C:MOUSEMMOUSE.COM

The first line of this batch file, @ECHO OFF, is programming command which hides all the command lines procedures from the user.
The second line is also a programming command that configures the CUI command prompt. The parameters after PROMPT tell the CUI what to show. The $P stands for current drive and path and $G stands for the greater than sign (>). Apart from those two parameters, a user can add any characters after PROMPT and itíll be shown as the command prompt.
The next command configures the CUI to search for files in that directory first before looking in its current location. The SET and PATH command procedures, even though different commands, are used in conjunction to configure CUI environment variables and the parameters displayed after that are what the CUI will search in first.
The next command is loading DOSís CD-Rom drive letter allocater (The CD-Rom driver must be loaded first in the CONFIG.SYS). The parameters after the executable file inform the CUI to allocate a particular drive letter for the CD-Rom and also may inform the CUI to allocate extended memory or how to read the CD-Rom in terms of speed and sectors. The LH configures the CUI to load this command procedure in high or extended memory.
The next command procedure allocates the Interrupt and Drive Memory allocation for the systemís sound card as well as informing the CUI of the sound cardís input/output range.
The next command procedure informs the CUI to look for all the drivers for the sound card in its parameters which will be a directory on the hard disk.
The last command loads the driver for the mouse. This command procedure doesnít need any parameters and is just a single command procedure telling the CUI to load that executable file.






















1.2 A Batch File Which Asks For User Input:

@echo off
cls
IF "%1"=="C" GOTO DRIVE
IF "%1"=="D" GOTO DRIVE
if "%1"=="c" goto drive
if "%1"=="d" goto drive

echo Please type INSTALL X (Replace X with your hard drive letter)
echo eg. INSTALL C
goto :quitinstall

:DRIVE
echo Welcome to the Batch Input Demo written by Leon Douglas.
echo.
echo Do You wish to continue?
choice /n Yes or No

cls
echo off
md %1:minstall
cd %1:minstall
echo off
copy a:inst2.bat
inst2

:quitinstall

Without going into excessive detail of this batch program, what it is accomplishing is a drive letter to install a program into as well as a yes or no instruction to continue. The first part of the batch file which is in bold is the piece of programming that requires a drive letter to be typed as a parameter to the batch file. It will only recognise C or D as drive letters, whether it be as uppercase or lowercase. If the user does not type a parameter or types a different drive letter other than C or D, the batch file will display a message that states a drive letter is required before continuing.

In the second piece of programming which is in italics is what the user will see if they type C or D as a parameter next to the batch fileís name as the command procedure. This part of the programming asks the user whether to continue with the installation or not. If the user types anything apart from yes,no,y or n the program will not proceed until the correct parameter is typed. If the user enters the correct parameter the program will proceed to the next step which is shown above in bold and Italics. This part of the batch program makes a directory on the given drive and then copies another batch file from the same location as itself to the directory it created. From here, this batch file terminates after the command procedure is given to start the other batch file.

1.3 Macros That Automate Procedures Within A GUI (Windows)
Within Windows 95 there are several ways