Equal-Sign Characters in Environment Variables (35937)



The information in this article applies to:
    Microsoft MS-DOS operating system 2.11
    Microsoft MS-DOS operating system 3.1
    Microsoft MS-DOS operating system 3.2
    Microsoft MS-DOS operating system 3.21
    Microsoft MS-DOS operating system 3.3
    Microsoft MS-DOS operating system 3.3a
    Microsoft MS-DOS operating system 4.0
    Microsoft MS-DOS operating system 4.01
    Microsoft MS-DOS operating system 5.0
    Microsoft MS-DOS operating system 5.0a
    Microsoft MS-DOS operating system 6.0
    Microsoft MS-DOS operating system 6.2
    Microsoft MS-DOS operating system 6.21
    Microsoft MS-DOS operating system 6.22

This article was previously published under Q35937

SUMMARY

When using environment variables in MS-DOS, you cannot include an equal sign as a character data/value section in an environment variable. The MS-DOS environment parser uses the equal sign as the delimiter between the name and the value of an environment variable. Thus, trying to set the environment variable "EXRC" to "TABS=4" as follows

set EXRC=TABS=4

would result in a syntax error. In OS/2, it is possible to set this environment variable by using the caret character (^) to "escape" the equal sign. Thus, under OS/2, it is possible to set the environment variable "EXRC" as follows:

set EXRC=TABS^=4


Modification Type: Major Last Reviewed: 5/12/2003
Keywords: KB35937