Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!ucbcad!ucbvax!decvax!tektronix!cae780!ubvax!scott From: scott@ubvax.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: DOS enviroment size Message-ID: <667@ubvax.UUCP> Date: Mon, 2-Mar-87 21:37:35 EST Article-I.D.: ubvax.667 Posted: Mon Mar 2 21:37:35 1987 Date-Received: Thu, 5-Mar-87 20:30:26 EST References: <2091@ncoast.UUCP> <409500003@prism> <2986@iuvax.UUCP> <119@homxb.UUCP> Organization: Ungermann-Bass, Inc., Santa Clara, CA Lines: 67 Keywords: subst, lastdrive, path In article <119@homxb.UUCP>, singhal@homxb.UUCP (S.SINGHAL) writes: >In article <2771@sdcsvax.UCSD.EDU>, holtz@beowulf.ucsd.edu (Fred Holtz) writes: >> >> The 'legitimate' way to create long path strings is to use the lastdrive >> option in config.sys and the subst command. Example: >> lastdrive=k (say the 'real' last drive is d:) >> >> subst e: c:\bin\util >> subst f: c:\bin\lang >> ...... >> path=d:\;c:\dos;c:\;e:\;f:\;g:\;h:\;i:\;j:\;k:\ >> > By using the following lines, you can create a PATH as long as you like > (subject to environment size limitations) : > > PATH=c:\;c:\this\that;c:\work\bin > PATH=%PATH%;c:\this\also;c:\ramres > PATH=%PATH%;c:\thats\all Actually, there's a much more severe restriction than the environment size--a DOS command line is limited to 128 bytes (or so). The %PATH% substitution from the environment is done before the command is parsed, and is subject to that limit. Last I heard, the %environment-name% mechanism (which many today have correctly posted only works within batch files) is undocumented, so like /e:nn in the SHELL command and the various commonly-known DOS patches you should use at your own risk. I can vouch that the %...% substitutions work fine in both DOS 3.2 and 3.1. On the subject of environments and paths, there are all kinds of options. I use a combination of all of these: 1) Expand your environment. I use the /e:nn in the SHELL command, but patching COMMAND.COM will work fine too. This isn't needed for a long path, but you'll probably want it to set all the other environment strings which are so useful. 2) Keep directory names short (this goes a long way!). Also, deep trees waste characters in pathnames. 3) The SUBST method above is very good, but results in a somewhat unreadable PATH. I use it just to shorten my pathnames. What I have done is put all my executable directories just below a single directory named SYS; then I "SUBST S: C:\SYS". My resulting path is pretty short: PATH=d:;s:\BAT\;s:\BIN\;s:\DOS\;s:\LC\;s:\NET\;s:\LW\; 4) Access executables via batch files! My BAT directory has more than 100 files! I get four advantages: a) a much shorter path; b) quick-and-dirty command name aliases; c) easy to provide such useful things as automatically printing help messages, defaulting parameters, and other useful things that command pre-processors provide; d) quick-and-dirty command chaining so I can type a whole string of commands on one line. I do this last by ending my batch files with a line of %1 %2 %3 %4 %5 %6 %7 %8 %9, plus proper use of SHIFT. Think about it. 5) If worse comes to worse, put all your executables into fewer directories. My BIN directory is such a miscellaneous one. While clunky and lacking in some ways, I've found it's possible to go a long way with DOS. You just need to play with it a while. -- "Ribbit!" Scott (Beam Me Up, Scotty!) Scheiman Industrial Networking Inc. `/\/@\/@\/\ ..decvax!amd!ubvax!scott 3990 Freedom Circle _\ \ - / /_ (408) 562-5572 Santa Clara, CA 95050