

If it exists, control passes to the YESPATH section otherwise, control is passed to the NOPATH section. This example tests for the existence of the PATH variable. GOTO The PATH environment variable was NOT detected. IF "%PATH%" = "" GOTO The PATH environment variable was detected. The following example illustrates the use of the PATH environment variable within a batch file: NOTE: The quotation marks are necessary only when a variable is used in a logical IF statement. If the statement is not true, that is, the VARIABLE variable does exist, program control skips to the next line of the batch file and continues. This example checks for the existence of the environment variable "VARIABLE." If VARIABLE does not exist, the statement is true and control of the batch file jumps to the MODULE section. The following example shows how to test for the existence of an environment variable: The article explains how you can access environment variables within MS-DOS batch files. How to Access Environment Variables in an MS-DOS Batch File Summary
