oem.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
SET--Examples
Syntax  Notes
────────────────────────────────────────────────────────────────────────────
 
                               SET──Examples
 
To set an environment variable named INCLUDE so that the string C:\INC (the
INC directory on drive C) is associated with it, type the following
command:
 
    set include=c:\inc
 
You can then use the string C:\INC in batch files by enclosing the name
INCLUDE with percent signs (%). For example, you might include the following
command in a batch file in order to display the contents of the directory
associated with the INCLUDE environment variable:
 
    dir %include%
 
When MS-DOS processes this command, the string C:\INC replaces %INCLUDE%.
 
Another possible use for the SET command is in a batch program that adds a
new directory to the PATH environment variable, as the following example
shows:
 
    @echo off
    rem ADDPATH.BAT adds a new directory
    rem to the PATH environment variable.
    set path=%1;%path%
    set
 
                                      ♦