[comp.os.msdos.programmer] PATH statement

jdb@reef.cis.ufl.edu (Brian K. W. Hook) (02/08/91)

My path statement has exceeded the legal limit allowed by DOS.  Is there
any way to extend this?  I thought the standard way would be to do:

CONFIG.SYS:

shell=c:\command.com /e:512 /p

Since my environment space was initially set to 256bytes.  Adding another
256 did not help.  I have one hard drive, so I have lots of stuff like:

PATH=C:\BIN\WINDOWS;C:\BIN\WINDOWS\EXCEL;C:\DOS\UTILS\NORTON50;etc. etc.

I tried using the SUBST for the more frequently accesed directories:

SUBST U: C:\DOS\UTILS

So I could use U: instead, but Windows 3.0 chokes on the SUBST command.

Any pointers?

Brian

glratt@uncle-bens.rice.edu (Glenn Forbes Larratt) (02/08/91)

In article <26780@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>
>My path statement has exceeded the legal limit allowed by DOS.  Is there
>any way to extend this?  I thought the standard way would be to do:
>
>CONFIG.SYS:
>
>shell=c:\command.com /e:512 /p
>
>Since my environment space was initially set to 256bytes.  Adding another
>256 did not help.  I have one hard drive, so I have lots of stuff like:
>
>PATH=C:\BIN\WINDOWS;C:\BIN\WINDOWS\EXCEL;C:\DOS\UTILS\NORTON50;etc. etc.

Expanding your environment space will only help if the error you're getting
is "Out of environment space" (pardon the Blinding Flash of the Obvious -
see below).

If by "has exceeded the legal limit allowed by DOS," you mean it has more
than 15/16 (can't remember which) directory paths specified, there is no
way in DOS that I know of to do this: however, a good solution is to have
a \BAT subdirectory which would be first or at least early in your path:
this would allow you to encapsulate particular software in a batch file
that temporarily adds the necessary path to your search path, executes your
program by full pathname (e.g. \DOS\UTILS\NORTON45\NI; this allows you to
name your batch file \BAT\NI.BAT), then prunes the search path.  Some
organization along these lines can go a long way.

Hope this helps.




--
	Glenn Larratt			glratt@uncle-bens.rice.edu
	Computing Resource Center	OCIS, Rice University, Houston, Texas

robert@ireq.hydro.qc.ca (R.Meunier 8516) (02/09/91)

In article <1991Feb8.072845.2809@rice.edu> glratt@uncle-bens.rice.edu (Glenn Forbes Larratt) writes:
>In article <26780@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
|>
|>CONFIG.SYS:
|>
|>shell=c:\command.com /e:512 /p
|>
|>PATH=C:\BIN\WINDOWS;C:\BIN\WINDOWS\EXCEL;C:\DOS\UTILS\NORTON50;etc. etc.
|
|If by "has exceeded the legal limit allowed by DOS," you mean it has more
|than 15/16 (can't remember which) directory paths specified, there is no
|way in DOS that I know of to do this: however, a good solution is to have
|a \BAT subdirectory which would be first or at least early in your path:
|this would allow you to encapsulate particular software in a batch file
|that temporarily adds the necessary path to your search path, executes your
|program by full pathname (e.g. \DOS\UTILS\NORTON45\NI; this allows you to
|name your batch file \BAT\NI.BAT), then prunes the search path.  Some
|organization along these lines can go a long way.



   A better way is to use the subst command to create special logical drive.
you add   lastdrive=z                in your config.sys
          subst c:\dos\utils u:      in your autoexec.bat

and change your path to
          path= ...  ;u:\norton50; ...



--
Robert Meunier                     Institut de Recherche d'Hydro-Quebec
Ingenieur                          1800 Montee Ste-Julie, Varennes
Internet: robert@ireq.hydro.qc.ca  Qc, Canada, J3X 1S1 
maintainer: BASIC mailing list request to basic-request@ireq.hydro.qc.ca

stanley@phoenix.com (John Stanley) (02/09/91)

glratt@uncle-bens.rice.edu (Glenn Forbes Larratt) writes:

> In article <26780@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hoo
> >
> >My path statement has exceeded the legal limit allowed by DOS.  Is there
> >any way to extend this?  I thought the standard way would be to do:
> >
> If by "has exceeded the legal limit allowed by DOS," you mean it has more
> than 15/16 (can't remember which) directory paths specified, there is no
> way in DOS that I know of to do this: however, a good solution is to have
> a \BAT subdirectory which would be first or at least early in your path:

   I have never seen a 15/16 directory path limit. I have seen the 127
character line length limit. Under 3.3, my current PATH is:

	PATH=C:\DOS;C:\;H:\;I:\;J:\;K:\;L:\;M:\;N:\;O:\;P:\;Q:\;R:\;T:\;U:\;
         V:\;W:\;X:\;Y:\;Z:\;C:\BATS

which is 21, if I counted right. I have SUBST's for everything from H: to
Z:, except S:.

   If you can't use SUBST's, you will probably be stuck creating a BAT
directory with bat files to run everything. 

glratt@uncle-bens.rice.edu (Glenn Forbes Larratt) (02/09/91)

In article <1991Feb8.072845.2809@rice.edu> I wrote:
>In article <26780@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>>
>>My path statement has exceeded the legal limit allowed by DOS.  Is there
...
>
>Expanding your environment space will only help if the error you're getting
>is "Out of environment space" (pardon the Blinding Flash of the Obvious -
>see below).
>
>If by "has exceeded the legal limit allowed by DOS," you mean it has more
>than 15/16 (can't remember which) directory paths specified, there is no
      ^^^^^

Mea culpa, mea maxima culpa: this is not a DOS limit, but one enforced (by
crashing and other nastiness) by Novell Netware (we're using ANW 2.15c).

I believe everything else I said is accurate.  My apologies.

		keeping the faith...

--
	Glenn Larratt			glratt@uncle-bens.rice.edu
	Computing Resource Center	OCIS, Rice University, Houston, Texas

tporczyk@na.excelan.com (Tony Porczyk) (02/12/91)

The News Manager)
Nntp-Posting-Host: na
Reply-To: tporczyk@na.excelan.com (Tony Porczyk)
Organization: Novell, Inc. San Jose, California
References: <26780@uflorida.cis.ufl.EDU>
Date: Sun, 10 Feb 1991 06:49:15 GMT

In article <26780@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>My path statement has exceeded the legal limit allowed by DOS.  Is there
>any way to extend this?  I thought the standard way would be to do:
>CONFIG.SYS:
>shell=c:\command.com /e:512 /p
>[stuff deleted followed by an example of path:]
>PATH=C:\BIN\WINDOWS;C:\BIN\WINDOWS\EXCEL;C:\DOS\UTILS\NORTON50;etc. etc.

Brian,

You path should not exceed 128 characters, regardless of the size of your
environment (increasing your environment is wonderful if you have a lot
of env. variables).
The easiest way to fix your problem is to rename your descriptive directory
names, and maybe to pull some of them from under the multilayers of other
directories. How about pulling NORTON to the surface? Same path you showed:
PATH=C:\WIN;C:\WIN\EXC;C:\NORTON;
See what I mean?
Also, if you have directories in the path that contain programs which could
be run using batch files without having that directory in the path, open
one directory called BATCH and put all of those wonderful *.bat's in there :)
Another way to do it, if you use different configurations, for, let's say,
programming, and another time Windows and other stuff, have two different
sets of CONFIG.SYS and AUTOEXEC.BAT with different environments.

Tony

rdippold@qualcomm.com (Ron Dippold) (02/12/91)

In article <26780@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>
>My path statement has exceeded the legal limit allowed by DOS.  Is there
>any way to extend this?  I thought the standard way would be to do:
> [CONFIG.SYS Stuff]
>Since my environment space was initially set to 256bytes.  Adding another
>256 did not help.  I have one hard drive, so I have lots of stuff like:

Your line to increase the environment space was correct, but no matter how big
you make your environment, your PATH still has a limit of 127 bytes.  There's
no easy way around it except the standard methods:
  * Move your directories up in the tree
  * Shorten some directory names
  * Combine directories (move NORTON stuff into UTIL, etc.)
  * Don't include something in the PATH if you can make a batch file that
    will find it for you and run it.

A lot of software insists that you have its directory in the PATH.  This is a
bogus statement so they won't have to explain to you how to make a batch file
to run it...  For instance I don't have XTree in my path, I just have a file
called X.BAT in my \UTIL directory that invokes it at the correct location.
You will find that you can do this with most of your programs.

    D

kolstad@jomby.cs.wisc.edu (Joel Kolstad) (02/12/91)

In article <1991Feb11.201752.17466@qualcomm.com> rdippold@qualcomm.com (Ron Dippold) writes:
>In article <26780@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>>
>>My path statement has exceeded the legal limit allowed by DOS.  Is there
>>any way to extend this?  I thought the standard way would be to do:
>> [CONFIG.SYS Stuff]
>>Since my environment space was initially set to 256bytes.  Adding another
>>256 did not help.  I have one hard drive, so I have lots of stuff like:
>
>Your line to increase the environment space was correct, but no matter how big
>you make your environment, your PATH still has a limit of 127 bytes.  There's
>no easy way around it except the standard methods:
 
[various methods described]
 
One other idea: Use 4DOS.  After using a "sane" operating system like Amiga
DOS or even UNIX, 4DOS is almost a must to keep your sanity.  ("You mean
I can't enter DEL <this> <that> <and the next thing>?" "And I can't COPY
<a> <b> <and c> <all to here>?"  "You gotta be kidding!")

4DOS is, in my opinion, an EXCELLENT package.

What concerns us here, though, is ALIASEs.  4DOS will let you have as many
aliases as you like... each alias can contain as many commands as you like,
as long as no single alias exceeds 255 characters.  And of course, aliases
can chain themselves to batch (BTM) files, more aliases, or whatever, if
need be.

Most of our "program" aliases are simple things like "NORTON=cdd c:\norton ^
ni"  Here, "cdd" is "change drive and directory" (in case you're sitting
on A:, cdd is a very useful internal 4DOS command), and the ^ separates
statements.
 
						---Joel Kolstad
						kolstad@jomby.cs.wisc.edu
						kolstad@cae.wisc.edu

yow@riddler.Berkeley.EDU (Billy Yow 283-4009) (02/12/91)

> 4DOS is, in my opinion, an EXCELLENT package.

Where can one find 4DOS?

			Thankz

                             Bill Yow
                             yow@sweetpea.jsc.nasa.gov

My opinions are my own!

mlord@bwdls58.bnr.ca (Mark Lord) (02/13/91)

<> >My path statement has exceeded the legal limit allowed by DOS.  Is there
<> >any way to extend this?  I thought the standard way would be to do:
<
< 127 character line length limit. Under 3.3, my current PATH is:
<
<	PATH=C:\DOS;C:\;H:\;I:\;J:\;K:\;L:\;M:\;N:\;O:\;P:\;Q:\;R:\;T:\;U:\;
<         V:\;W:\;X:\;Y:\;Z:\;C:\BATS
<
<which is 21, if I counted right. I have SUBST's for everything from H: to

SUBST confuses a lot of disk utilities.  I prefer to simply have a longer PATH
variable.  There are numerous routines to permit this, many of which are 
available from SIMTEL and other archives.  

I even have my own, APPENV21, which simply provides a command for appending
arbitrary text to the end of an existing environment variable, such as PATH.

For example:

	set PATH=c:\bin;c:\dos;c:\norton;c:\spedstor;c:\qemm;d:\video;
	appenv PATH=d:\com\rbcomm33;d:\archiver\zoo;
-- 
 ___Mark S. Lord__________________________________________
| ..uunet!bnrgate!mlord%bmerh724 | Climb Free Or Die (NH) |
| MLORD@BNR.CA   Ottawa, Ontario | Personal views only.   |
|________________________________|________________________|

w8sdz@rigel.acs.oakland.edu (Keith Petersen) (02/13/91)

yow@riddler.Berkeley.EDU (Billy Yow 283-4009) writes:
>Where can one find 4DOS?

WSMR-SIMTEL20.ARMY.MIL [26.2.0.74]

NOTE: Type B is Binary; Type A is ASCII

Directory PD1:<MSDOS.4DOS>
 Filename   Type Length   Date    Description
==============================================
4D2411.ZIP    B    7006  901229  TSR critical error handler (INT 24) for 4DOS
4D30REF.ZIP   B    8332  900323  4DOS v3 special chars/variables help ref. 1of2
4D30REF2.ZIP  B    9422  900323  4DOS v3 special chars/variables help ref. 2of2
4DOS302A.ZIP  B  364356  901029  4DOS v3.02a, enhanced COMMAND.COM replacement
4DOSTIP.ARC   B    3744  890512  Notes on '4DOS' DOS cmd processor replacement
4DTECH01.ZIP  B    8693  900517  Official 4DOS technical notes #1 for 4DOS 3.0
4EDIT10.ZIP   B   30350  900323  4DOS full screen directory description editor
4EDIT106.ZIP  B   34169  910205  4DOS full screen directory description editor
4HELP.ARC     B   86135  900201  Improved help for 4DOS v2.x command processor
4MAP.ZIP      B   42206  901116  Customize 4DOS command line editor keybindings
4ZIP.ZIP      B   60546  900713  A utility for 4DOS, ZIP descriptions with file
SVALIAS.ARC   B    5558  900109  Saves 4DOS aliases in a file for later use

Keith
-- 
Keith Petersen
Maintainer of SIMTEL20's MSDOS, MISC & CP/M archives [IP address 26.2.0.74]
Internet: w8sdz@WSMR-SIMTEL20.Army.Mil    or     w8sdz@vela.acs.oakland.edu
Uucp: uunet!umich!vela!w8sdz                          BITNET: w8sdz@OAKLAND

userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) (02/13/91)

In article <5334@s3.ireq.hydro.qc.ca>, robert@ireq.hydro.qc.ca (R.Meunier 8516) writes:
>In article <1991Feb8.072845.2809@rice.edu> glratt@uncle-bens.rice.edu (Glenn Forbes Larratt) writes:
>>In article <26780@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>|>
>|>CONFIG.SYS:
>|>
>|>shell=c:\command.com /e:512 /p
>|>
>|>PATH=C:\BIN\WINDOWS;C:\BIN\WINDOWS\EXCEL;C:\DOS\UTILS\NORTON50;etc. etc.
>|
>|If by "has exceeded the legal limit allowed by DOS," you mean it has more
>|than 15/16 (can't remember which) directory paths specified, there is no
>|way in DOS that I know of to do this: however, a good solution is to have
>|a \BAT subdirectory which would be first or at least early in your path:
>|this would allow you to encapsulate particular software in a batch file
>|that temporarily adds the necessary path to your search path, executes your
>|program by full pathname (e.g. \DOS\UTILS\NORTON45\NI; this allows you to
>|name your batch file \BAT\NI.BAT), then prunes the search path.  Some
>|organization along these lines can go a long way.
> 
> 
> 
>   A better way is to use the subst command to create special logical drive.
>you add   lastdrive=z                in your config.sys
>          subst c:\dos\utils u:      in your autoexec.bat
> 
>and change your path to
>          path= ...  ;u:\norton50; ...
> 
I don't know if that's "better" than the "BAT suggestion.
Having a looooong PATH means that all those directories
are searched whenever DOS decides that what you have
typed is not an internal command. OK I lied, it stops
searching when it finds what it is looking for.
 
 -------------------+-------------------------------------------
 Al Dunbar          | 
 Edmonton, Alberta  |  Disclaimer: "I disclaim disclaimers"
 CANADA             |                              
 -------------------+-------------------------------------------

tporczyk@na.excelan.com (Tony Porczyk) (02/13/91)

The News Manager)
Nntp-Posting-Host: na
Reply-To: tporczyk@na.excelan.com (Tony Porczyk)
Organization: Novell, Inc. San Jose, California
References: <26780@uflorida.cis.ufl.EDU> <1991Feb11.201752.17466@qualcomm.com> <1991Feb12.001051.18375@spool.cs.wisc.edu> <1991Feb12.091712@riddler.Berkeley.EDU>
Date: Tue, 12 Feb 1991 18:07:27 GMT

In article <1991Feb12.091712@riddler.Berkeley.EDU> yow@riddler.Berkeley.EDU (Billy Yow 283-4009) writes:
>> 4DOS is, in my opinion, an EXCELLENT package.
>Where can one find 4DOS?
>                             Bill Yow

You can either download it from Compuserve, or you can just call 617-646-3975
(JP Software) and get more info on how to order.
It's an outstanding package. I would recommend you just give them a call.

Tony

ts@uwasa.fi (Timo Salmi) (02/13/91)

In article <1991Feb11.201752.17466@qualcomm.com> rdippold@qualcomm.com (Ron Dippold) writes:
>In article <26780@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>>
>>My path statement has exceeded the legal limit allowed by DOS.  Is there
>>any way to extend this?  I thought the standard way would be to do:
:

   As many posters have pointed out, the generic answer is no.  You
have to resort to round-abouts.  One trick not mentioned yet (as far
as I recall) is temporarily appending directories to the path, and
then deleting the extra directories from the path then they are no
longer needed.  Having excessive long paths is not a good idea
anyway, since they involve a slow-up. 
   Addpath and delpath facilities can be found in /pc/ts/tsbat23.arc
at grabo.uwasa.fi anonymous ftp archives. 

...................................................................
Prof. Timo Salmi        
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

rlw@IDA.ORG (Richard Wexelblat) (02/14/91)

A good way to handle long paths and infrequently used directories that
will work both in windows and outside is to set up a series of bat
files in your local equivalent of /bat or /usr for these infrequently
used directories.

Thus, the way I get into Norton or my infrequently used database of
stickylabels is through a bat file that does the following:

save the path
set the path to just the directory of current interest (+ root)
run whatever I want to run
restore the path

If you call one of these things recursively, you'll loose the original
path, though.  But there are ways to get around this, too if you really
need to recurse.  The disadvantage of this is having to have extra bat
files and ending in semi-limbo if you ^C out of the bat file.  So there's
an oops.bat that restores the original path for me.
-- 
--Dick Wexelblat  (rlw@ida.org) 703 845 6601
  Only vampires don't have to look at themselves in the mirror.

jmr5125@rigel.tamu.edu (Mason Reed) (02/15/91)

In article <1991Feb14.123101.683@IDA.ORG>, rlw@IDA.ORG (Richard Wexelblat) writes...
> 
>A good way to handle long paths and infrequently used directories that
>will work both in windows and outside is to set up a series of bat
>files in your local equivalent of /bat or /usr for these infrequently
>used directories.

The way I handle it is to simply use subst to simplify the paths.  For
instance:

  subst z: c:\dos\path\utilities
  subst x: c:\dos\path\mice
and so forth.  Then in you set your path as follows:
  set path=z:\;x:\;...
All this requires is that you have DOS 3.3(?) or better, and you insert the
line "lastdrive=z" into your config.sys (so that you can define drive letters
above C: or D: or whatever).  Hope this helps.

daparish@biivax.dp.beckman.com (02/16/91)

In article <26780@uflorida.cis.ufl.EDU>, jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
> 
> My path statement has exceeded the legal limit allowed by DOS.  Is there
> any way to extend this?  I thought the standard way would be to do:
> shell=c:\command.com /e:512 /p
> PATH=C:\BIN\WINDOWS;C:\BIN\WINDOWS\EXCEL;C:\DOS\UTILS\NORTON50;etc. etc.
> I tried using the SUBST for the more frequently accesed directories:
> SUBST U: C:\DOS\UTILS
> So I could use U: instead, but Windows 3.0 chokes on the SUBST command.
> Brian

I suggest creating a c:\bat directory which is included in the PATH.
remove for example c:\dos\util\norton50, create a batch file \BAT\NU.BAT =
c:\dos\norton\nu %1 %2 		or whatever.

and add any other dos commands required (such as cd if necc.).

do the same for any other programs.
this keeps the path short for a very small overhead (and saves searching all
those damn directories for every command).