Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!vsi1!octopus!stever From: stever@Octopus.COM (Steve Resnick ) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Setting the path variable in autoexec.bat Keywords: path Message-ID: <1990Jul3.201009.11781@Octopus.COM> Date: 3 Jul 90 20:10:09 GMT References: <1102@valinor.ACA.MCC.COM> <1990Jun28.211556.10833@Octopus.COM> <857@bbt.UUCP> Reply-To: stever@octopus.UUCP (Steve Resnick ) Distribution: usa Organization: Octopus Enterprises, Cupertino CA Lines: 43 In article <857@bbt.UUCP> djb@bbt.UUCP (beauvais) writes: >In article <1990Jun28.211556.10833@Octopus.COM> stever@octopus.UUCP (Steve Resnick ) writes: >>In article <1102@valinor.ACA.MCC.COM> hang@valinor.ACA.MCC.COM (Hang Ho Ng) writes: >>>I have a number of paths that I want to include in the PATH variable in >>>autoexec.bat file. Could someone tell me how to do it? >> >>This was covered a couple of months ago. The DOS limitation on command >>strings (PATH= for instance) is 128 bytes. If your path is longer than >>that you will either need some program to allow you to enter a longer string. >>(Of which I don't know of any) or you will need to limit your path to a smaller >>size and use batch files to assist in navigation. > >True, a DOS command line IS limited to 128 characters. So, use more than >one command line! Try something like this... > >path=c:\dos;c:\;d:\utils >path=%path%;d:\wp;d:\edit > >The %path% means "whatever the current path is." The second line appends >the new stuff to the value of %path%. This works fine in DOS 3.3 - I use >it all the time for paths longer than 132 characters. > I don't know what you are running, but my version of DOS (Generic MS DOS 3.30) will not do this. There is a good reason, it has to do with the way that COMMAND.COM expands environment variables. When command encounters a word enclosed in percent symbols it substitutes the value of the environment variable (or "" is it doesn't exist). Once all expansions are done the command gets executed (I know I missed a few items in there). The point is that the command string is >128 bytes before it gets executed. I don't know what version of DOS you are running, but the stuff from Microsoft will not do a path (or any other command) greater than 128 bytes. Cheers! Steve -- -------------------------------------------------------------------------------- Steve Resnick - 408/241-1533 Process Scientific, Inc. "0x2B|~0x2B THAT is the question!"