Article View: comp.sys.ibm.pc
Article #44019Re: How can I set a PATH longer than 128 bytes ?
From: Richard Flamsholt S0rensen
Date: Tue, 13 Mar 1990 14:32
Date: Tue, 13 Mar 1990 14:32
93 lines
4835 bytes
4835 bytes
>mlord@bnr-rsc.UUCP (Mark Lord) writes:
><heath@ncrcae.Columbia.NCR.COM (Robert Heath) says:
><
><How can I set my dos PATH variable longer than 128 bytes? I'm running
>
>You need APPENV21.ARC from simtel20. I use it to set my own 500 byte PATH.
~~~~~~~~
500 byte ?! Whatever happened to the idea about keeping all your
batch-files in one directory, say C:\BATCH ??
My path covers DOS\DOS330, DOS\DOSEXTRA (system utilities, that I
don't wanna mingle with "pure" DOS), BATCH and SYSTEM\NORTON - and
thats it.
I know, that some programs might cause trouble if they can't locate
all of their files and that the usual solution is to either CD to the
proper directory or to include that directory in your path. However,
I've succesfully applied a number of other methods during the years so
here's a few hints (they are all based on the idea about having a
dedicated BATCH-directory holding all your batch files - and it's a
neat idea!)
1 : Use APPEND to append a directory to the path, eg
append c:\text\wp50 /* appends the directory */
c:\text\wp50\wp %1 /* better use absolute path ..*/
append ; /* skip the appended directory */
Since APPEND is a resident program, you'd better install it at
startup time, by adding this to your AUTOEXEC.BAT:
append c:\ /* install APPEND */
append ; /* forget the dummy-appending */
By doing this, you have full access to your wp50-directory and
executing the batch file doesn't change your working directory.
2 : The appending of a directory to a path can also be done like this:
set temp=%path% /* remember current path */
set path=%path%;c:\text\wp50 /* add directory */
c:\text\wp50\wp %1 /* same as before ... */
set path=%temp% /* restore old path */
set temp= /* delete "temp"-variable */
This assumes that you do *have* a path, but you probably do ...
3 : 4DOS-users could use the following approach, which is a bit easier:
setlocal /* begin "local" mode */
set path=%path;c:\text\wp50 /* same as before */
c:\text\wp50\wp %& /* %& means "all arguments" */
endlocal /* back to normal ! */
4 : The last resort (seem to remember, that GEM likes it this way)
is to substitute a drive letter for the desired directory and
change to that drive whenever you need to run the program. Usually,
the need for this rarely happens, so you can set up the drives
in your AUTOEXEC.BAT:
subst e: c:\cad\gem
(Remember to set lastdrive=z or something in your CONFIG.SYS) In
the batch file, write (arrgh, need I elaborate - well, allright..)
e: /* change to fake drive e: */
e:gemvdi %1 %2 %3 /* <hmm - is this the command ??> */
This can't get you back to your starting position when exeting
the batch file, unless you use 4DOS or the like - here goes
set temp=%disk /* remember the disk */
e: etc etc /* ho hum */
temp /* change back to <temp>-drive */
set temp= /* delete temp-variable */
(Actually, I haven't tried this one, but I'm 99.8% sure it works ...)
Im sure there's a lot of other ways to handle this (like, say,
invoking yet another command.com to run the batchfile, which therefore
has a *copy* of the environment it can change anyway it prefers - or
similar outrageous ideas !), but these have served me well for a long
time - and I keep *my* path below 128 characters >:-)
Bye now,
Richard Flamsholt
richard@iesd.auc.dk
PS: Oh, and BTW, I don't have a directory called c:\text\wp50, but I
*do* have c:\text\pctex and c:\text\emacs (need I say more ;-)
Technical Details
Message-ID:
<RICHARD.90Mar13153221@church.iesd.auc.dk>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!mintaka!think!samsung!cs.utexas.edu!uunet!mcsun!sunic!dkuug!iesd!iesd.auc.dk!richardReferences:
<5762@ncrcae.Columbia.NCR.COM< <90059.112138GILLA@QUCDN.BITNET> <2270@bnr-rsc.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!mintaka!think!samsung!cs.utexas.edu!uunet!mcsun!sunic!dkuug!iesd!iesd.auc.dk!richard From: richard@iesd.auc.dk (Richard Flamsholt S0rensen) Newsgroups: comp.sys.ibm.pc Subject: Re: How can I set a PATH longer than 128 bytes ? Message-ID: <RICHARD.90Mar13153221@church.iesd.auc.dk> Date: 13 Mar 90 14:32:21 GMT References: <5762@ncrcae.Columbia.NCR.COM< <90059.112138GILLA@QUCDN.BITNET> <2270@bnr-rsc.UUCP> Sender: news@iesd.auc.dk (UseNet News) Organization: Mathematics and Computer Science, University of Aalborg Lines: 93 In-reply-to: mlord@bnr-rsc.UUCP's message of 6 Mar 90 17:37:24 GMT