Increase length of system Path environment variable? 
Author Message
 Increase length of system Path environment variable?

Can someone (preferably from Microsoft, but I'll take anyone's input)
confirm or deny this?

"On NT and Win2K, environment variables can't be longer than 1023
characters, even with environment variable expansion, even with COMSPEC =
%SystemRoot%\system32\cmd.exe /e:32768"

Is there any other way to increase the system PATH size?  We are stuck with
using dozens of applications that require things appended to the path in
order to run properly, and we are about to reach the limit (we didn't write
them but we're stuck with using them.)

2. Details:
Through experimentation, we determined that the maximum size of any
environment variable on Windows NT 4.0 and Windows 2000 is 1023 characters.
The Windows user interface for modifying environment variables limits data
entry to 1023.  You can go directly into the registry
(HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session
Manager\Environment) and put in something bigger than that (I put in 5K of
data), but  from a DOS prompt it still truncates at 1023.  If you try
running it from the "Start|Run" window it still will only use a search path
limited to 1023 characters.  The behavior is exactly the same no matter what
the environment size is in COMSPEC (tried the default, then 2048, and then
the max, 32768)

For environment variables that contain other environment variables, the
limit is still 1023 even after expansion, so everything else is truncated
after the 1023 char limit.

I re-read the knowledgebase article, Q158141, "How to Specify Additional
Environment Space under Windows NT," and realized it just talks about
environment space, not enviroment variable length.  (Correct me if I'm
wrong, but "environment space" should be the sum of all environment
variables, maybe some other overhead I'm not aware of.)  I was originally
mislead/confused because I saw about a dozen different newsgroup replies,
FAQs, and articles from various sources that referenced this article and
recommended changing COMPSPEC to fix problems with the Path length.
Evidentally this was bad advice, at least for Windows NT 4.0 and Win2K.

A lot of the articles recommended setting the evironment space to 2048, but
we did a quick count of all the environment variables on a DOS prompt on one
of our "bricks" (images/bundled systems) and we've exceed 2048 characters.
I think what happened is this article was updated for Windows 2000 but they
forgot to mention what the default environment space (not path length) is,
and they also kept the example at 2048 because earlier versions of the
article used that number in their examples.

Following references support the behavior I experienced (path limited to
1023 characters):

1. http://www.*-*-*.com/

2. MSDN KnowledgeBase Article Q169888, "User-Define Path Dropped When User
and System Paths Too Large"
(The bug itself is supposed to be fixed in a service pack, but the "More
Information" section in this article still seems to hold true.)

The maximum length of the combined system and user-defined path variables is
1,023 characters. This does not includes the "path=" portion of either.

The system path is limited to the maximum path length of 1,023 characters.
The user-defined path is limited to maximum 511 characters, but is limited
to 1,023 minus the system path.

It is possible that the system path can use the total allocated environment
space, causing the user-defined path to get truncated or not show up at all.

Quote:
-----Original Message-----
From: <deleted>
Sent: <deleted>
To: <deleted>
Subject: MSDN KB Q158141, "How to Specify Additional Environment Space under

Windows NT" was RE: Windows Search Path

Finally found it...  MSDN Knowledge Base Article Q158141, "How to Specify
Additional Environment Space under Windows NT"

In Windows 2000:
1. In Control Panel, double-click System.
2. Click the Advanced tab, click Environment Variables. In the System
variables, click ComSpec.
3. To increase the amount of environment space, use the following syntax:
ComSpec = <drive:\windir>\system32\cmd.exe /e:2048
where <drive:\windir> is the drive and folder where the Windows 2000 system
files are located.
(My note: try to use ComSpec = %systemroot%\system32\cmd.exe /e:2048)

The maximum size for the /E: switch is 32768 bytes.

Same for NT, except you get to the environment dialog a slightly different
way.

-----Original Message-----
From: <deleted>
Sent: <deleted>
To: <deleted>
Cc: <deleted>
Subject: Windows Search Path
. . .
I frequently come across problems with my Windows search path when I load
new applications onto my system. It seems that both NT and W2K have problems
with search paths of more than 512 characters.  Is someone working on
reducing the search path for on our systems and/or increasing the valid
maximum path length?



Wed, 29 Sep 2004 05:23:27 GMT  
 Increase length of system Path environment variable?

Quote:

> Can someone (preferably from Microsoft, but I'll take anyone's input)
> confirm or deny this?

> "On NT and Win2K, environment variables can't be longer than 1023
> characters, even with environment variable expansion, even with COMSPEC =
> %SystemRoot%\system32\cmd.exe /e:32768"

> Is there any other way to increase the system PATH size?  We are stuck with
> using dozens of applications that require things appended to the path in
> order to run properly, and we are about to reach the limit (we didn't write
> them but we're stuck with using them.)

Why do you need to increase the path size?  Can't you simply start your
applications from batch files and set the path in each batch file to whatever
that application requires before the batch file invokes the application?

--

u n z i p    m y    a d d r e s s    t o    s e n d    e - m a i l



Wed, 29 Sep 2004 07:42:21 GMT  
 Increase length of system Path environment variable?
what about using setx.exe ................

--
MS MVP   2002
NT4 MVP 1999-2000

Quote:

> Can someone (preferably from Microsoft, but I'll take anyone's input)
> confirm or deny this?

> "On NT and Win2K, environment variables can't be longer than 1023
> characters, even with environment variable expansion, even with COMSPEC =
> %SystemRoot%\system32\cmd.exe /e:32768"

> Is there any other way to increase the system PATH size?  We are stuck with
> using dozens of applications that require things appended to the path in
> order to run properly, and we are about to reach the limit (we didn't write
> them but we're stuck with using them.)

> 2. Details:
> Through experimentation, we determined that the maximum size of any
> environment variable on Windows NT 4.0 and Windows 2000 is 1023 characters.
> The Windows user interface for modifying environment variables limits data
> entry to 1023.  You can go directly into the registry
> (HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session
> Manager\Environment) and put in something bigger than that (I put in 5K of
> data), but  from a DOS prompt it still truncates at 1023.  If you try
> running it from the "Start|Run" window it still will only use a search path
> limited to 1023 characters.  The behavior is exactly the same no matter what
> the environment size is in COMSPEC (tried the default, then 2048, and then
> the max, 32768)

> For environment variables that contain other environment variables, the
> limit is still 1023 even after expansion, so everything else is truncated
> after the 1023 char limit.

> I re-read the knowledgebase article, Q158141, "How to Specify Additional
> Environment Space under Windows NT," and realized it just talks about
> environment space, not enviroment variable length.  (Correct me if I'm
> wrong, but "environment space" should be the sum of all environment
> variables, maybe some other overhead I'm not aware of.)  I was originally
> mislead/confused because I saw about a dozen different newsgroup replies,
> FAQs, and articles from various sources that referenced this article and
> recommended changing COMPSPEC to fix problems with the Path length.
> Evidentally this was bad advice, at least for Windows NT 4.0 and Win2K.

> A lot of the articles recommended setting the evironment space to 2048, but
> we did a quick count of all the environment variables on a DOS prompt on one
> of our "bricks" (images/bundled systems) and we've exceed 2048 characters.
> I think what happened is this article was updated for Windows 2000 but they
> forgot to mention what the default environment space (not path length) is,
> and they also kept the example at 2048 because earlier versions of the
> article used that number in their examples.

> Following references support the behavior I experienced (path limited to
> 1023 characters):

> 1. http://www.jsiinc.com/SUBD/tip1900/rh1907.htm

> 2. MSDN KnowledgeBase Article Q169888, "User-Define Path Dropped When User
> and System Paths Too Large"
> (The bug itself is supposed to be fixed in a service pack, but the "More
> Information" section in this article still seems to hold true.)

> The maximum length of the combined system and user-defined path variables is
> 1,023 characters. This does not includes the "path=" portion of either.

> The system path is limited to the maximum path length of 1,023 characters.
> The user-defined path is limited to maximum 511 characters, but is limited
> to 1,023 minus the system path.

> It is possible that the system path can use the total allocated environment
> space, causing the user-defined path to get truncated or not show up at all.

> -----Original Message-----
> From: <deleted>
> Sent: <deleted>
> To: <deleted>
> Subject: MSDN KB Q158141, "How to Specify Additional Environment Space under
> Windows NT" was RE: Windows Search Path

> Finally found it...  MSDN Knowledge Base Article Q158141, "How to Specify
> Additional Environment Space under Windows NT"

> In Windows 2000:
> 1. In Control Panel, double-click System.
> 2. Click the Advanced tab, click Environment Variables. In the System
> variables, click ComSpec.
> 3. To increase the amount of environment space, use the following syntax:
> ComSpec = <drive:\windir>\system32\cmd.exe /e:2048
> where <drive:\windir> is the drive and folder where the Windows 2000 system
> files are located.
> (My note: try to use ComSpec = %systemroot%\system32\cmd.exe /e:2048)

> The maximum size for the /E: switch is 32768 bytes.

> Same for NT, except you get to the environment dialog a slightly different
> way.

> -----Original Message-----
> From: <deleted>
> Sent: <deleted>
> To: <deleted>
> Cc: <deleted>
> Subject: Windows Search Path
> . . .
> I frequently come across problems with my Windows search path when I load
> new applications onto my system. It seems that both NT and W2K have problems
> with search paths of more than 512 characters.  Is someone working on
> reducing the search path for on our systems and/or increasing the valid
> maximum path length?



Thu, 30 Sep 2004 01:18:43 GMT  
 Increase length of system Path environment variable?
On Fri, 12 Apr 2002 16:42:21 -0700, Phil Robyn

Quote:


>> Can someone (preferably from Microsoft, but I'll take anyone's input)
>> confirm or deny this?

>> "On NT and Win2K, environment variables can't be longer than 1023
>> characters,

>Why do you need to increase the path size?  Can't you simply start your
>applications from batch files and set the path in each batch file to whatever
>that application requires before the batch file invokes the application?

Presumably these are Win32 apps that won't run in the same environment
space as a batch file calling the application.

Therefore, although (with the correct rights) you can use SETX to
change the system path on the fly, this would almost certainly cause
problems as soon as users start running multiple apps at the same time
-  If every batch file replaces the whole path then only the last
application is going to work correctly - If every batch file appends
to the path then you will run into the limit (and will need some
mechanism to remove duplicates from the path)

Although it's not pretty, the easiest workaround is to use SUBST to
map the long paths to drive letters, so C:\program files\my app
becomes T:\

Another option that may be worth trying under Win 2K is to use RUNAS
having a different user account (with different user path) for each
app.
So the application's PATH is under:
HKCU\Environment

General PATH under:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

Lastly it's worth experimenting with shortcut properties, some
applications will run quite happily if the directory is simply set
under the shortcut property START IN:
-
Simon Sheppard
Web: http://www.ss64.com

-



Fri, 01 Oct 2004 00:10:04 GMT  
 Increase length of system Path environment variable?

Quote:

> Can someone (preferably from Microsoft, but I'll take anyone's input)
> confirm or deny this?

> "On NT and Win2K, environment variables can't be longer than 1023
> characters, even with environment variable expansion, even with COMSPEC =
> %SystemRoot%\system32\cmd.exe /e:32768"

> Is there any other way to increase the system PATH size?  We are stuck with
> using dozens of applications that require things appended to the path in
> order to run properly, and we are about to reach the limit (we didn't write
> them but we're stuck with using them.)

You can create a VBScript for each program and let the user launch them instead:

' This script will add a folder to the existing path and start a program.
' It will only apply to the current session ("Process" a.k.a the running
VBScript) and
' it's subsequent child processes.

' Path to add
sAddOn = "c:\test\newpath"

Set WshShell = CreateObject("WScript.Shell")
Set WshProcessEnv = WshShell.Environment("Process")

sCurrPath = WshProcessEnv("PATH")

If Right(sCurrPath, 1) = ";" Then
  sNewPath = sCurrPath & sAddOn
Else
  sNewPath = sCurrPath & ";" & sAddOn
End If

' Set the environment variable
WshProcessEnv("PATH") = sNewPath

' Start the program that is placed in sAddOn
WshShell.Run "newprog.exe"

--
torgeir



Fri, 01 Oct 2004 07:56:22 GMT  
 Increase length of system Path environment variable?
We've already done this as much as possible and are still hitting the limit.
Problem is that we have a huge system (about 50 different pieces) with lots
of legacy applications and Unix ports, especially government crap.


Quote:

> > Can someone (preferably from Microsoft, but I'll take anyone's input)
> > confirm or deny this?

> > "On NT and Win2K, environment variables can't be longer than 1023
> > characters, even with environment variable expansion, even with COMSPEC
=
> > %SystemRoot%\system32\cmd.exe /e:32768"

> > Is there any other way to increase the system PATH size?  We are stuck
with
> > using dozens of applications that require things appended to the path in
> > order to run properly, and we are about to reach the limit (we didn't
write
> > them but we're stuck with using them.)

> Why do you need to increase the path size?  Can't you simply start your
> applications from batch files and set the path in each batch file to
whatever
> that application requires before the batch file invokes the application?

> --

> u n z i p    m y    a d d r e s s    t o    s e n d    e - m a i l



Sat, 02 Oct 2004 23:19:55 GMT  
 Increase length of system Path environment variable?
same limit


Quote:
> what about using setx.exe ................

> --
> MS MVP   2002
> NT4 MVP 1999-2000




Quote:
> > Can someone (preferably from Microsoft, but I'll take anyone's input)
> > confirm or deny this?

> > "On NT and Win2K, environment variables can't be longer than 1023
> > characters, even with environment variable expansion, even with COMSPEC
=
> > %SystemRoot%\system32\cmd.exe /e:32768"

> > Is there any other way to increase the system PATH size?  We are stuck
with
> > using dozens of applications that require things appended to the path in
> > order to run properly, and we are about to reach the limit (we didn't
write
> > them but we're stuck with using them.)

> > 2. Details:
> > Through experimentation, we determined that the maximum size of any
> > environment variable on Windows NT 4.0 and Windows 2000 is 1023
characters.
> > The Windows user interface for modifying environment variables limits
data
> > entry to 1023.  You can go directly into the registry
> > (HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session
> > Manager\Environment) and put in something bigger than that (I put in 5K
of
> > data), but  from a DOS prompt it still truncates at 1023.  If you try
> > running it from the "Start|Run" window it still will only use a search
path
> > limited to 1023 characters.  The behavior is exactly the same no matter
what
> > the environment size is in COMSPEC (tried the default, then 2048, and
then
> > the max, 32768)

> > For environment variables that contain other environment variables, the
> > limit is still 1023 even after expansion, so everything else is
truncated
> > after the 1023 char limit.

> > I re-read the knowledgebase article, Q158141, "How to Specify Additional
> > Environment Space under Windows NT," and realized it just talks about
> > environment space, not enviroment variable length.  (Correct me if I'm
> > wrong, but "environment space" should be the sum of all environment
> > variables, maybe some other overhead I'm not aware of.)  I was
originally
> > mislead/confused because I saw about a dozen different newsgroup
replies,
> > FAQs, and articles from various sources that referenced this article and
> > recommended changing COMPSPEC to fix problems with the Path length.
> > Evidentally this was bad advice, at least for Windows NT 4.0 and Win2K.

> > A lot of the articles recommended setting the evironment space to 2048,
but
> > we did a quick count of all the environment variables on a DOS prompt on
one
> > of our "bricks" (images/bundled systems) and we've exceed 2048
characters.
> > I think what happened is this article was updated for Windows 2000 but
they
> > forgot to mention what the default environment space (not path length)
is,
> > and they also kept the example at 2048 because earlier versions of the
> > article used that number in their examples.

> > Following references support the behavior I experienced (path limited to
> > 1023 characters):

> > 1. http://www.jsiinc.com/SUBD/tip1900/rh1907.htm

> > 2. MSDN KnowledgeBase Article Q169888, "User-Define Path Dropped When
User
> > and System Paths Too Large"
> > (The bug itself is supposed to be fixed in a service pack, but the "More
> > Information" section in this article still seems to hold true.)

> > The maximum length of the combined system and user-defined path
variables is
> > 1,023 characters. This does not includes the "path=" portion of either.

> > The system path is limited to the maximum path length of 1,023
characters.
> > The user-defined path is limited to maximum 511 characters, but is
limited
> > to 1,023 minus the system path.

> > It is possible that the system path can use the total allocated
environment
> > space, causing the user-defined path to get truncated or not show up at
all.

> > -----Original Message-----
> > From: <deleted>
> > Sent: <deleted>
> > To: <deleted>
> > Subject: MSDN KB Q158141, "How to Specify Additional Environment Space
under
> > Windows NT" was RE: Windows Search Path

> > Finally found it...  MSDN Knowledge Base Article Q158141, "How to
Specify
> > Additional Environment Space under Windows NT"

> > In Windows 2000:
> > 1. In Control Panel, double-click System.
> > 2. Click the Advanced tab, click Environment Variables. In the System
> > variables, click ComSpec.
> > 3. To increase the amount of environment space, use the following
syntax:
> > ComSpec = <drive:\windir>\system32\cmd.exe /e:2048
> > where <drive:\windir> is the drive and folder where the Windows 2000
system
> > files are located.
> > (My note: try to use ComSpec = %systemroot%\system32\cmd.exe /e:2048)

> > The maximum size for the /E: switch is 32768 bytes.

> > Same for NT, except you get to the environment dialog a slightly
different
> > way.

> > -----Original Message-----
> > From: <deleted>
> > Sent: <deleted>
> > To: <deleted>
> > Cc: <deleted>
> > Subject: Windows Search Path
> > . . .
> > I frequently come across problems with my Windows search path when I
load
> > new applications onto my system. It seems that both NT and W2K have
problems
> > with search paths of more than 512 characters.  Is someone working on
> > reducing the search path for on our systems and/or increasing the valid
> > maximum path length?



Sat, 02 Oct 2004 23:21:30 GMT  
 Increase length of system Path environment variable?
Hate to see everyone go through all this trouble for a workaround.  We've
already using the local PATH in scripts and batch files (similar to your
example below) as much as possible and are still hitting the limit.  Problem
is that we have a huge system (about 50-60 different pieces of software)
with lots of legacy applications and Unix ports, especially government crap.
We are not allowed to change a lot of the software directly... anyway, a
workaround isn't an option.  Just wanted verification that there is no way
to increase the character limit for environment variables.

Once I have documentation backing this up (the newsgoup replies do help) I
have to approach the contractors and government people and file complaints,
etc.  A lot of this software is written by people who are just porting
things from Unix to Windows, and they don't care how they write their code.
We've exhausted the scripting and batch file workarounds suggested
already...


Quote:

> > Can someone (preferably from Microsoft, but I'll take anyone's input)
> > confirm or deny this?

> > "On NT and Win2K, environment variables can't be longer than 1023
> > characters, even with environment variable expansion, even with COMSPEC
=
> > %SystemRoot%\system32\cmd.exe /e:32768"

> > Is there any other way to increase the system PATH size?  We are stuck
with
> > using dozens of applications that require things appended to the path in
> > order to run properly, and we are about to reach the limit (we didn't
write
> > them but we're stuck with using them.)

> You can create a VBScript for each program and let the user launch them
instead:

> ' This script will add a folder to the existing path and start a program.
> ' It will only apply to the current session ("Process" a.k.a the running
> VBScript) and
> ' it's subsequent child processes.

> ' Path to add
> sAddOn = "c:\test\newpath"

> Set WshShell = CreateObject("WScript.Shell")
> Set WshProcessEnv = WshShell.Environment("Process")

> sCurrPath = WshProcessEnv("PATH")

> If Right(sCurrPath, 1) = ";" Then
>   sNewPath = sCurrPath & sAddOn
> Else
>   sNewPath = sCurrPath & ";" & sAddOn
> End If

> ' Set the environment variable
> WshProcessEnv("PATH") = sNewPath

> ' Start the program that is placed in sAddOn
> WshShell.Run "newprog.exe"

> --
> torgeir



Sat, 02 Oct 2004 23:30:21 GMT  
 Increase length of system Path environment variable?
You really are stuck.  This is a fairly fundamental limitation.  The strategies
you can apply are limited to controlling the path length by some means; you
won't be able to increase it.

(1) Use Phil's technique as much as possible.
(2) If you can, make individual path elements short by using very short
folder/sharenames and directly sharing the root of individual folders you use.
(3) Use the SUBST command to extend the reach of individual path elements.


Quote:
> We've already done this as much as possible and are still hitting the limit.
> Problem is that we have a huge system (about 50 different pieces) with lots
> of legacy applications and Unix ports, especially government crap.




> > > Can someone (preferably from Microsoft, but I'll take anyone's input)
> > > confirm or deny this?

> > > "On NT and Win2K, environment variables can't be longer than 1023
> > > characters, even with environment variable expansion, even with COMSPEC
> =
> > > %SystemRoot%\system32\cmd.exe /e:32768"

> > > Is there any other way to increase the system PATH size?  We are stuck
> with
> > > using dozens of applications that require things appended to the path in
> > > order to run properly, and we are about to reach the limit (we didn't
> write
> > > them but we're stuck with using them.)

> > Why do you need to increase the path size?  Can't you simply start your
> > applications from batch files and set the path in each batch file to
> whatever
> > that application requires before the batch file invokes the application?

> > --

> > u n z i p    m y    a d d r e s s    t o    s e n d    e - m a i l



Sat, 02 Oct 2004 23:34:24 GMT  
 Increase length of system Path environment variable?
n> Can someone (preferably from Microsoft, but I'll take anyone's input)
n> confirm or deny this?

<URL:http://groups.google.com/groups?selm=3BCD43BA.3C0FA2B6%40tesco.net>

n> Is there any other way to increase the system PATH size?

The limit you are experiencing is _not_ the limit on the length of the
environment variable.  Environment variables can be a lot longer than
1023 characters.  The limit that you are experiencing is the limit on
the length of command lines, which indirectly affects the lengths of
environment variables only inasmuch as it restricts how long the command
tail passed to a SET command can be.

<URL:http://groups.google.com/groups?selm=3BC84045.F2189625%40tesco.net>

n> [...] from a DOS prompt [...]
n> [...] all the environment variables on a DOS prompt [...]

<URL:http://homepages.tesco.net./~J.deBoynePollard/FGA/a-cli-is-not-a-dos-...>



Fri, 29 Oct 2004 02:57:38 GMT  
 Increase length of system Path environment variable?
I wondering.  Is it necessary that the path be complete at all times?
Can chop it up?


Sat, 30 Oct 2004 09:28:16 GMT  
 Increase length of system Path environment variable?
I wrote a program in an alternative script that attempted to
set the path to some huge string.  It wouldn't work.  I also
attempted to set this environmental to something huge thru the
control panel, system, env tab.  It choked too.  I have this
feeling there is a real limit to the path env.  But I don't
have any inside info.   Clay?  You there?

Love Marge.

Just tried to set ANY env to a long string.  Doesn't work.  There
does seem to be a limit.  But I'm not sure.  Will be interested to see
how to do it.

NT 4sp6


Quote:
> n> Can someone (preferably from Microsoft, but I'll take anyone's input)
> n> confirm or deny this?

> <URL:http://groups.google.com/groups?selm=3BCD43BA.3C0FA2B6%40tesco.net>

> n> Is there any other way to increase the system PATH size?

> The limit you are experiencing is _not_ the limit on the length of the
> environment variable.  Environment variables can be a lot longer than
> 1023 characters.  The limit that you are experiencing is the limit on
> the length of command lines, which indirectly affects the lengths of
> environment variables only inasmuch as it restricts how long the command
> tail passed to a SET command can be.

> <URL:http://groups.google.com/groups?selm=3BC84045.F2189625%40tesco.net>

> n> [...] from a DOS prompt [...]
> n> [...] all the environment variables on a DOS prompt [...]

> <URL:http://homepages.tesco.net./~J.deBoynePollard/FGA/a-cli-is-not-a-dos-...>



Sat, 30 Oct 2004 10:00:41 GMT  
 Increase length of system Path environment variable?


Quote:
>I wrote a program in an alternative script that attempted to
>set the path to some huge string.  It wouldn't work.  I also
>attempted to set this environmental to something huge thru the
>control panel, system, env tab.  It choked too.  I have this
>feeling there is a real limit to the path env.  But I don't
>have any inside info.   Clay?  You there?

>Love Marge.

>Just tried to set ANY env to a long string.  Doesn't work.  There
>does seem to be a limit.  But I'm not sure.  Will be interested to see
>how to do it.

I could only set an environment variable to about 2040 characters in
Win2K using the command line.  I the Sytems tab, the limitation was
only 155 characters, for some odd reason.

Clay Calvert
Replace "W" with "L" in email.



Sat, 30 Oct 2004 10:53:19 GMT  
 Increase length of system Path environment variable?
Risking being jumped for wandering 'off topic', I'd like to see a
cut of what's going on here.  Why do you need a path so long?  Not
saying you don't, just would like to see the application.  Thanks.
Quote:

> We've already done this as much as possible and are still hitting the limit.
> Problem is that we have a huge system (about 50 different pieces) with lots
> of legacy applications and Unix ports, especially government crap.




> > > Can someone (preferably from Microsoft, but I'll take anyone's input)
> > > confirm or deny this?

> > > "On NT and Win2K, environment variables can't be longer than 1023
> > > characters, even with environment variable expansion, even with COMSPEC
>  =
> > > %SystemRoot%\system32\cmd.exe /e:32768"

> > > Is there any other way to increase the system PATH size?  We are stuck
>  with
> > > using dozens of applications that require things appended to the path in
> > > order to run properly, and we are about to reach the limit (we didn't
>  write
> > > them but we're stuck with using them.)

> > Why do you need to increase the path size?  Can't you simply start your
> > applications from batch files and set the path in each batch file to
>  whatever
> > that application requires before the batch file invokes the application?

> > --

> > u n z i p    m y    a d d r e s s    t o    s e n d    e - m a i l



Sat, 30 Oct 2004 23:59:57 GMT  
 Increase length of system Path environment variable?
I am betting the system tab issue is a limitation in registry string value size.

The line length, you are only  99.7% right about...  it's apparently 2046
characters.

If you ever try to drag and drop a lot of files onto a script in the shell,
you'll see the same limit crop up - it dies a2046 characters...


Quote:


> >I wrote a program in an alternative script that attempted to
> >set the path to some huge string.  It wouldn't work.  I also
> >attempted to set this environmental to something huge thru the
> >control panel, system, env tab.  It choked too.  I have this
> >feeling there is a real limit to the path env.  But I don't
> >have any inside info.   Clay?  You there?

> >Love Marge.

> >Just tried to set ANY env to a long string.  Doesn't work.  There
> >does seem to be a limit.  But I'm not sure.  Will be interested to see
> >how to do it.

> I could only set an environment variable to about 2040 characters in
> Win2K using the command line.  I the Sytems tab, the limitation was
> only 155 characters, for some odd reason.

> Clay Calvert
> Replace "W" with "L" in email.



Sun, 31 Oct 2004 07:18:14 GMT  
 
 [ 21 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Expanding SYSTEM %PATH% with embedded SYSTEM environment variable problem

2. cscript and the PATH-environment variable

3. Building paths with environment variables

4. Environment variable PATH

5. Error in changing the Path Environment variable

6. set environment variable path

7. Reading Environment Variables on Remote Systems

8. Setting System Environment Variables

9. System environment variables

10. set system path and eviroment variables

11. environment variables: wshshell.environment or wshshell.expandenv ironmentstrings?

12. -Free plugin to compute path lengths for Illustrator (Mac/Win)

 

 
Powered by phpBB® Forum Software