Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hplsla!davidr From: davidr@hplsla.HP.COM (David M. Reed) Newsgroups: comp.sys.ibm.pc Subject: Re: DOS 3.30 PATH and Environment lengths Message-ID: <5190026@hplsla.HP.COM> Date: 27 Jul 89 21:17:17 GMT References: <3695@i.sei.cmu.edu> Organization: HP Lake Stevens, WA Lines: 55 My experience is that while you can expand the size of the DOS environment, none of the environment variables can take more than ~128 bytes. When I found that I could not increase the length of my PATH variable I began to use a variety of tricks. One thing is to use short directory names (2-4 characters): (okay) PATH=C:\BAT;C:\UTIL;C:\DOS;C:\WIN And while I like to have a fairly structured directory system, I try to make certain that and directory that needs to be in the search path is at the root level, thus avoiding the lenthy /dir/subdir names: (not okay) PATH=C:\USR\BIN;C:\USR\LOCAL\BIN;C:\USR\CONTRIB\BIN (okay) PATH=C:\BIN;C:\LBIN;C:\CBIN One trick I have not used but know of is to use the SUBST command preceeding the PATH statement. That way you can assign a psuedo-drive letter to a path which makes for much shorter entries: (in CONFIG.SYS) LASTDRIVE = Z (in AUTOEXEC.BAT) SUBST E: C:\USR\LOCAL\BIN PATH=C:\;E: The most recent thing I have been doing is to keep directories out of the PATH variable that are not used frequently, or do not have a lot of programs to be found in them. (Generally I have a directory in the search PATH only if it has a lot of programs.) I start my major applications from BATch files (all of which I place in the C:\BAT directory), that way their directory does not need to be in the search PATH: (C:\BAT\JUNK.BAT) ECHO OFF PUSHDIR > NUL C: CD \PROG_DIR PROGRAM %1 %2 %3 %4 %5 POPDIR > NUL NOTE: I like to see the initial ECHO OFF so that I can easily distinguish whether I am starting a program directly or indirectly, the latter being something I am able to modify if I need or want. Some applications need to have their directory in the search PATH, but since their directory only needs to be in the search PATH while the program is running, then modify the PATH before starting: (C:\BAT\WORD.BAT) ECHO OFF PUSHDIR > NUL SET OLDPATH=%PATH% SET PATH=%PATH%;C:\PROG_DIR C: CD \PROG_DIR PROGRAM %1 %2 %3 %4 %5 SET PATH=%OLDPATH% POPDIR > NUL