Configuring A Windows Working Environment


Table of Contents

1. Introduction
2. Setting up environment variables

The environment is an area of memory associated with the command processor that provides up to 32KB of space for storing variables, the variables contain information about the operating environment that is used by the operating system and other programs in various ways, typically to inform a program of the location of a certain piece of information it requires. A few examples follow:

Sometimes it is necessary to modify certain environment variables, for instance, we may have installed a new program in a directory such as C:\tools\chipper\, and its executable files may be stored in C:\tools\chipper\bin\. We may desire to execute this program from the command line but find that we get an error saying something like:

'chipper' is not recognized as an internal or external command, operable program or batch file.
    

Because we had not updated the PATH to point to the location of the binary files for this program.

In order to use the tools you are inherently going to have to install it is necessary to setup the operating environment so that the tools know where to find stuff they need and the operating system knows where to find the tools. You must understand how to do this as you will frequently be asked to change the operating environment.

Windows contains an environment variable called PATH, this is a list of directories which tell windows where to look for executable files, commands typed in at the command prompt. When you type in a command, windows will search the directories listed in PATH to see if it can find it. Since most of the tools we will be installing run from the command prompt we will have to extend the PATH environment variable so that windows knows about our tools and we can use them.

Altering environment variables will depend on what version of Windows you are using, in NT and Windows 2000 it is quite straightforward:

In order to setup environment variables on Windows 95/98, you need to edit a file called autoexec.bat, this is located at C:\autoexec.bat, opening it with notepad is sufficient. If you do not like notepad then try clicking start/run and then typing sysedit this will bring up a built in editor for your system files, which crashed on my system. Or if you really desire so, you could type.

      C:\>editautoexec.bat
    

Do what ever is necessary to edit the file, it should look something like this:

@echo off
SET SOUND=C:\PROGRA~1\CREATIVE\CTSND
SET BLASTER=A220 I5 D1 H5 P330 E620 T6
SET PATH=C:\WINDOWS;C:\ 
LH C:\WINDOWS\COMMAND\MSCDEX.EXE /D:123 
LH C:\MOUSE\MOUSE.EXE
DOSKEY
CLS
    

autoexec.bat is executed on startup in order to setup your computer so that the drivers for your hardware are loaded etc. This is also where it sets up environment variables, you should be able to see that the line.

SET PATH=C:\WINDOWS;C:\

Is how autoexec.bat defines the PATH environment variable. To append to this list of directories simply add ";" and then add the new directory path to the end. In the example above, there are two paths specified and these are separated by a ";". You will have to reboot your system in order for these environment variables to be set. Separate filenames with ";"' but do not put a ";" on the absolute end of the list.

[Note]Note

To add an environment variable to autoexec.bat all we have to do is insert a new line defining the variable, for example, if we wanted to add an environment variable called SGML_CATALOG_FILES we would add the line:

SET SGML_CATALOG_FILES=C:\docbook\docbk41\docbook.cat;C:\docbook\openjade\dsssl\catalog
      

If you are using WindowsME goto start/programs/accessories/systemtools/system information. This will bring up a window entitled Microsoft Help and Support. Goto the tools menu and select the system configuration utility, select the environment tab, select PATH and click on edit. To append to the list just type your directory onto the end of the list. Separate filenames with ";"' but do not put a ";" on the absolute end of the list.