Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DOS environment variables > 128 chars ?

190 views
Skip to first unread message

D. Curtis Deno

unread,
Aug 21, 1992, 8:59:43 PM8/21/92
to
Fellow netlanders,

I would appreciate your suggestions on the matter of environment variables
whose length exceeds the 128 (127?) character limit.

I have used a utility program (appenv) to construct lengthy environment
variables. In particular, I use a PATH of about 200 characters to allow
easy access to DOS, a set of utilities, several compilers, and some
applications. I know this is longer than Microsoft recommends but I am
not fond of cryptic directory names and am wary of SUBST drive letters.
I do not wish to switch between multiple AUTOEXEC.BAT or CONFIG.SYS files.

Almost all programs work fine under this condition. DOS itself will search
the entire PATH string for .exe files. My SHELL= line in the config.sys
file specifies a total environment space of 1024 bytes and this usually
leaves a comfortable 200-400 bytes to spare. I am using MS-DOS 5.0.

My DOS and Windows applications seem quite happy, except for 1 ...

This particular application uses the Phar Lap 386 DOS extender and won't
shell out to DOS properly if any environment variable is > 128 characters.
At least 1 other Phar Lap 386 DOS extended product is not so limited.

What is the story here? I deplore a 128 character limit and fortunately
found that very few of my applications care.

Must I introduce SUBST drive letters as shorthand for directories? If
so, what are the possible complications?
Is NDOS or 4DOS or xxx superior in this respect?
What might go wrong if I continue to use such a long PATH?

-- Curt Deno

DAVID SCOTT PASCHAL

unread,
Aug 22, 1992, 3:39:38 PM8/22/92
to

Hi. The only reason environment variables are "limited" to 128 characters is
because of COMMAND.COM's 128-character limitation for command lines, which is
based on DOS's 128-character limitation for passing command-line parameters to
child processes. Except for what you mentioned, the only problem I can forsee
with using too-long environment variables is when you put a line in a batch file
that references environment variables, such as:

@echo off
set oldpath=%path%
path c:\new.dir\to.add\to.path;%path%
.
. (do something)
.
path %oldpath%

When COMMAND.COM expands lines contining %variable% or %number, any characters
past the 128th or so are truncated. Thus, you will lose part of your PATH in
the fragment above!

Tschuess,
David Paschal

Kate Wilson

unread,
Aug 23, 1992, 3:06:18 PM8/23/92
to
In article <1992Aug22.0...@pasteur.Berkeley.EDU> dcd...@bellini.berkeley.edu (D. Curtis Deno) writes:
>I would appreciate your suggestions on the matter of environment variables
>whose length exceeds the 128 (127?) character limit.
[stuff deleted]

> Is NDOS or 4DOS or xxx superior in this respect?

4DOS will allow a command line up to 255 characters.

0 new messages