Environment variables

22 February 2003 by Snakefoot | Comment » | Trackback Off
In the DOS environment memory is reserved for user defined variables. Enviroment variables can be used for different things: To list all environment variables in memory:

SET | more

To show the value of a single environment variable:

SET CLASSPATH

ECHO %CLASSPATH%

To change the value or create a single environment variable:

SET CLASSPATH=.;C:\JDK

To append to an existing environment variable:

SET CLASSPATH=%CLASSPATH%;C:\MY_JAVA

To clear or delete a single environment variable:

SET CLASSPATH=

Note when using SET from the command prompt then the environment variable will only live temporarily and will be forgotten when the command environment closes. To make a permanent environment variable move the SET of the variable to the AUTOEXEC.BAT.

Related Configure how much memory to allocate for environment variables
Related Batch file input parameters are accessed like environment variables

More Info MS KB Q36605
More Info MS KB Q41246
More Info MS KB Q66292
More Info MS KB Q121170
More Info MS KB Q153163

Updated: 2 July 2007

Leave a comment


NB! Use the Forum for computer help and off-topic questions.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>