SETPATH - create DOS PATH from file Syntax SETPATH [D:\PATH\]FILENAME.EXT Parameters FILENAME.EXT is the name of the path file; a standard ASCII file which contains the names of ALL the directories in the DOS PATH. The format of the file is simple: one path entry per line, exactly as they would appear in the SET PATH= command: C:\ C:\MSDOS D:\UTILS . etc.... Comments SETPATH will create the DOS PATH from the entries in FILENAME.EXT. As with ADDPATH/REMPATH, SETPATH will validate each entry, but with a twist: if an invalid entry is found in the path file, SETPATH will beep three times, display an appropriate error message with the invalid entry and its location in the file, and will wait five seconds before continuing. If you use SETPATH as a replacement for the DOS PATH command in AUTOEXEC.BAT, this feature is very useful, since PATH will still be built, but you will be notified of the error. If you missed the error display, re- run SETPATH from the command line. SETPATH can be used as often as desired; it will create a complete new DOS PATH each time it is run. Note that the current "." and parent ".." directory entries are allowed in the SETPATH file. Although DOS automatically searches the current directory before searching the path, this feature allows you to list matching files in the current and/or parent directory when using the SRCHPATH program. IMPORTANT NOTE: DOS ENVIRONMENT SPACE The PATH variable is stored in the DOS environment, which normally defaults to 160 bytes. If your PATH contains many directories, or if you already use a large number of environment variables (e.g., you have many SET commands in AUTOEXEC.BAT), DOS may issue an "out of environment space" message. In such cases, you should increase environment allocation via the SHELL command in CONFIG.SYS: SHELL=C:\COMMAND.COM /P /E:XXXX where XXXX is the desired environment space, in bytes. If you had sufficient environment space before you used SETPATH, and you did not use the SHELL command in CONFIG.SYS, then the value XXXX should be equal to: 165 + total size of the entries contained in the FILENAME.EXT file + total number of entries in FILENAME.EXT file. If you used the SHELL command in CONFIG.SYS, then you should replace 165 with your current environment size in the formula above. EXAMPLE You do not use a SHELL command, and you ran out of environment space when running SETPATH. Path entries in PATH.DAT are as follows: C:\ (3 characters) C:\DOS (6 characters) C:\UTIL (7 characters) D:\GENERAL\BAT (14 characters) F:\WINDOWS (10 characters) The total length of the entries is 3+6+7+14+10=40 characters. The formula above yields: 165 + 40 (length of entries) + 5 (number of entries) = 210 You should add the following statement to CONFIG.SYS: SHELL=C:\COMMAND.COM /P /E:210 Note: The above method guarantees sufficient environment space to store the PATH value. However: - If you increase the number of entries in your path file or if you add SET commands in AUTOEXEC.BAT, you may have to increase environment space again. - If you did not have a SHELL command in CONFIG.SYS, you may not have exceeded the 160 bytes default by much, and the above method will allocate more environment than is actually needed (160 bytes at worst). - If you want freedom from worry, purposely over-allocate environment space by assigning a larger value to the /E: value -- but don't do it if you need every available byte of DOS memory. - A utility such as QuarterDesk's Manifest (included in the last few releases of the QEMM memory manager) will let you know if you are over-allocating your environment, and by how much. - The DOS 6.0 MEM /D command will also show the amount of allocated environment.