Setting Environment Variables


Environment variables need to be set for WinGX, Ortep, Dirdif and Platon. They are used by the programs to find the necessary files. Unfortunately, the way that this is done depends on whether you are using Windows 95 or Windows 98/ME or Windows NT/2000 or Windows XP/VISTA (the method for Windows 7 & 8 is quite similar to that for Windows XP/VISTA).

This page describes how to set environment variables.

NOTE - The examples given below use the environment variable WINGXDIR. If you are setting up a program other than WINGX, you will need to use other variable names !!!

If you have done as described below and errors are still reported then see here.

For Windows 95
It is necessary to manually edit the file AUTOEXEC.BAT with a text editor (NOT a word processor like Word). The file is in your top directory (normally c:\AUTOEXEC.BAT). You will need to add a line to set each variable at the bottom of this file. The syntax for this is :
set "environment variable"="value"
where appropriate values for the strings "environment variable" and "value" are given. "environment variable" is the name of the variable and "value" is normally a FULL pathname which will depend on your installation (i.e. where you chose to put the program). For example, to set the environment variable WINGXDIR when you have installed the program in the default location "c:\wingx" then
set WINGXDIR=c:\wingx
You must then reboot your computer to effect these changes in the AUTOEXEC.BAT file

For Windows 98/ME
While it is possible to set environment variables in the same way as for Windows 95 by editing the file AUTOEXEC.BAT, it is easier to use the Microsoft facility MSCONFIG (which does this for you).

For Windows 98, first run MSCONFIG from the task bar:

Select the "Autoexec.bat" pane, then go to the bottom of the window, select the last entry and click the "New" button. A small input window appears below the last entry, and in this you should type a new entry with the exact syntax as shown in the example below. This example shows how to set the environment variable WINGXDIR when you have installed the program in the default location "c:\wingx", but obviously is you are setting a different environment variable, then different values are typed in.

Then click "OK" and a small pen appears against the entry, indicating that the AUTOEXEC.BAT file will be modified.

The following window then appears, indicating that you need to reboot your computer to make these changes effective.

For Windows ME, the process is identical, except that the last Window does not appear and it is not necessary to reboot the computer.

For Windows 2000/NT

For Windows 2000/NT, this needs to be done using the System Properties dialog box. Click on the "My Computer" icon to get the Window shown here.

Then click on the "Control Panel" icon to get the Window shown here.

Then click on the "System" icon to get the "System Properties" Dialog Box.

For Windows NT use the "Environment" tab instead of the "Advanced" tab. Click on the "Environment Variables" button to give a Window like

Then click the "New..." button to give an entry Window like this

Enter the variable name and its value in the boxes and then click "OK".

If there are several users on the PC, it is probably better to set the variables as "System variables", rather than "User variables" since they will then automatically be accessible for all users. You will need to have Administrator priviliges to do this.

For Windows XP or VISTA

For Windows XP or VISTA, this needs to be done using the System Properties dialog box. Click on the Start menu and "Control Panel" icon as shown here (appearance of VISTA Windows may be slightly different).

This gives the "Control Panel" Window. Click on the "System" icon. .

This gives the "System Properties" Dialog box. Select the "Advanced" tab and click on the "Environment Variables" button

This give the Environment Variables entry Window as shown below

Then click the "New..." button to give an entry Window like this

Enter the variable name and its value in the boxes and then click "OK".

If there are several users on the PC, it is probably better to set the variables as "System variables", rather than "User variables" since they will then automatically be accessible for all users. You will need to have Administrator priviliges to do this.

Louis J. Farrugia

School of Chemistry, Joseph Black Building,
University Of Glasgow, Glasgow G12 8QQ
Telephone +44 (0)141 330 5137
FAX +44 (0)141 330 4888

E-mail louis.farrugia@glasgow.ac.uk

Back to FAQ Page