Wednesday, March 12, 2008

Setting Environment Variables

An instruction stored in the MS-DOS environment that controls, for example, how to display the DOS prompt, where to store any temporary files, and the path of directories that DOS searches to find commands. The PATH, COMSPEC, PROMPT, and SET commands in the AUTOEXEC.BAT file all define environment variables.

Environment variables are strings that contain information such as drive, path, or file name. They control the behavior of various programs. For example, the TEMP environment variable specifies the location in which programs place temporary files.

In Windows 95/98/ME, append these lines to the end of your c:\autoexec.bat using notepad, and then reboot your computer:
1. set Temp=%USERPROFILE%\Local Settings\Temp

set TMP=%USERPROFILE%\Local~1\Temp
(Syntax : set variableName=variableValue)

In Windows NT/2000/XP, follow the following steps:
1. Open Control Panel
2. Click the System icon and the window pops up
3. Go to the Advanced pane

4. Click the Environment Variables button

5. There are two seperated windows showing two sets of environment variables. Select the "new" button for the upper window to create a new environment variable.Select the "Edit" button for the upper window to edit an existing environment variable. Probably you need to create the "Temp" and "TEMP" variable, and edit the "PATH" variable.


6. For Example the value of "TEMP" will be %USERPROFILE%\Local Settings\Temp
7. The value of "TMP" will be %USERPROFILE%\Local~1 \Temp.
8. You should add these values to the beginning of your "PATH" variable. If you want to specify any path of the software ,you can set using the path vairable.

For Ex :

set path=C:\Program Files\Java\jdk1.5.0_07;C:\bea\jdk142_05;

The above path specify the path od Java Software.

common predefined environment variables :