- Batch files can use them for temporary storing values during executions.
- When creating environment variables in a batch file, then one must remember to clear them again before exiting, or else they continue to live on and consume memory after the batch file have executed.
- Global variables specified in Autoexec.bat, which affects the behavior of the DOS environment and programs executed within the environment:
To show the value of a single environment variable:
SET | more
To change the value or create a single environment variable:
To append to an existing environment variable:
To clear or delete a single environment variable:
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 KB36605
More Info MS KB41246
More Info MS KB66292
More Info MS KB121170
More Info MS KB153163