Use SET to set a DOS or OS/2 environment variable to a specified value.
For OS/2 workstations, SET commands affect the environment only while the login script is running; the settings disappear when LOGIN terminates.
SET has the following command format:
[TEMP] SET name="value"
Replace name with an environment parameter that identifies the environment you want to change.
Replace value with identifier variable substitutions. Values must be enclosed in quotation marks.
To change the environment for the login script, but not for the workstation after the login script has finished executing, use the optional keyword TEMP.
Use the SET login script command the same way you use the DOS command SET. However, when you use SET in a login script, you must enter quotation marks (`` '') around values.
The SET commands do not have to be included in login scripts.
For example, you may decide that it is easier to put some SET commands in the workstation's AUTOEXEC.BAT file. Where you use SET commands depends upon your individual needs.
For information about values you can set, see the SET command in your DOS or OS/2 documentation.
See the SHELL command in your DOS manual for more information about the environment size. (OS/2 workstations do not have this limitation.)
After you use the SET command to set a value for an environment variable, you can use that variable in other login script commands.
To include an environment variable as an identifier variable in a command, enclose the name of the variable in angle brackets, for example, <emailuser>.
For example:
SET PROMPT="$P$G"``$P'' lists the current directory path; ``$G'' displays a ``>'' (greater than) character. See your DOS or OS/2 manual for more information.
SET PATH="G:\REPORTS\DAILY"This sets the variable PATH to G:\REPORTS\DAILY.
To display this path, you can include PATH as an identifier variable in a WRITE command by enclosing the variable (not the value) in angle brackets. For example, the following line displays ``My path is G:\REPORTS\DAILY''.
WRITE "My path is "%<path>
For example, you could include the following lines in a login script to set and map a drive to the variable NWS:
SET NWS="C:\XYZ" MAP S16:=%<NWS>