🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #987

Re: Setting the path variable in autoexec.bat

#987
From: Craig Schreiner
Date: Thu, 05 Jul 1990 19:51
34 lines
2377 bytes
In article <857@bbt.UUCP>, djb@bbt.UUCP (beauvais) writes:
> In article <1990Jun28.211556.10833@Octopus.COM> stever@octopus.UUCP (Steve Resnick ) writes:
1 >In article <1102@valinor.ACA.MCC.COM> hang@valinor.ACA.MCC.COM (Hang Ho Ng) writes:
1 >>I have a number of paths that I want to include in the PATH variable in
1 >>autoexec.bat file. Could someone tell me how to do it?
1 >
1 >This was covered a couple of months ago. The DOS limitation on command
1 >strings (PATH=<foo> for instance) is 128 bytes. If your path is longer than 
1 >that you will either need some program to allow you to enter a longer string.
1 >(Of which I don't know of any) or you will need to limit your path to a smaller
1 >size and use batch files to assist in navigation.
> > 
2 > True, a DOS command line IS limited to 128 characters.  So, use more than
2 > one command line!  Try something like this...
2 > 
2 > path=c:\dos;c:\;d:\utils
2 > path=%path%;d:\wp;d:\edit
2 > 
2 > The %path% means "whatever the current path is."  The second line appends
2 > the new stuff to the value of %path%.  This works fine in DOS 3.3 - I use
2 > it all the time for paths longer than 132 characters.

This won't work!  Using the %PATH% expands the contents of the PATH
environment before executing the command line.  Therefore if your
PATH is say some 100 bytes long and you attempt to add another 30 bytes
and then counting for the 5 bytes for the PATH= command, your system
will either crash (depending on hardware versions, like some I've used)
or just continue truncating the path to the 128 bytes.  Unfortunately
there is no real good solution to solving this problem except by
batching or stuffing one directory full of all your executables to
get around this symptom.  Too bad newer version of DOS weren't made
to allow longer command lines!
-----
Craig
Technical Details
Message-ID: <2653@aspect.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!censor!comspec!humvax!becker!hybrid!scifi!bywater!uunet!aspect!craig
References: <1102@valinor.ACA.MCC.COM> <1990Jun28.211556.10833@Octopus.COM> <857@bbt.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!comspec!humvax!becker!hybrid!scifi!bywater!uunet!aspect!craig
From: craig@aspect.UUCP (Craig Schreiner)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Re: Setting the path variable in autoexec.bat
Summary: %PATH% won't work either...
Keywords: path
Message-ID: <2653@aspect.UUCP>
Date: 5 Jul 90 19:51:55 GMT
References: <1102@valinor.ACA.MCC.COM> <1990Jun28.211556.10833@Octopus.COM> <857@bbt.UUCP>
Distribution: usa
Organization: Aspect Telecommunications, San Jose, Ca
Lines: 34