how to add a large bulk of path into system path environment variable?

G

gino

Hi folks,

I need to add a large bulks of directory paths into system path environment
variable. In the "Control Panel/System/Environment Variables" panel, I can
edit the path variable, but it has limited length, I guess it is limited to
1024 chars.

But I need to add over 100 paths and I guess it will be 10240 chars that I
need to add into the system path environment variable.

I have all these paths in a text file.

1. How to add them once all into a system path environment variable?

2. Is there a dynamic way that I can load these paths and after using them,
I can off-load these paths dynamically without rebooting my WINDOWS XP?

3. Is the length of PATH variable limited? Can I increase them to 10240
chars?

Thanks a lot for your help!

-Gino
 
S

Shenan Stanley

gino said:
I need to add a large bulks of directory paths into system path
environment variable. In the "Control Panel/System/Environment
Variables" panel, I can edit the path variable, but it has limited
length, I guess it is limited to 1024 chars.

But I need to add over 100 paths and I guess it will be 10240 chars
that I need to add into the system path environment variable.

I have all these paths in a text file.

1. How to add them once all into a system path environment variable?

2. Is there a dynamic way that I can load these paths and after using
them, I can off-load these paths dynamically without rebooting my
WINDOWS XP?

3. Is the length of PATH variable limited? Can I increase them to
10240 chars?

I have no solution for you, but I have to ask why you need so much in your
path.. I administer environments with as many as 100 individual
applications installed and never have had a need for that much in the system
path....
 
J

Jetro

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.

Path settings are cumulative. You can add your path to the existed path as
"path=%path%;{yourpath}". If environment really demands flexible path, you
can start the applications from the batch file. Beware of duplicate
executives in the different directories included into path.
 
C

Carrie Garth

| "gino" <http://www.microsoft.com/communities/privacy.mspx>
| wrote in message | Hi folks,
|
| I need to add a large bulks of directory paths into system path
| environment variable. <SNIP> I need to add over 100 paths
| and I guess it will be 10240 chars <SNIP> I have all these
| paths in a text file. <SNIP> Is there a dynamic way that I can
| load these paths <SNIP>

While I cannot be sure since you left out specifics, perhaps
using App Paths registry entries (where each application stores
it own path the registry) would serve your needs. For more
information see the following Google Groups archived
newsgroup post (SNIPPED below for brevity).

----- Begin Original Message -----
Message-ID: <[email protected]>
Date: Fri, 02 May 2003 19:53:34 +0200
From: "Torgeir Bakken (MVP)" <[email protected]>
Subject: Re: Start|Run pathing
Newsgroups: microsoft.public.win2000.general
Google Link to archived newsgroup post:
http://www.google.com/[email protected]

<SNIP>
"App Paths" is a system-wide setting. It contains keys named
after applications, for example "Iexplore.exe". Each key contains
a default string set to the full path of the named program, and a
key named Path that contains a path string. It performs much
the same function as a DOS search path.

If you click Start, Run and type a program name without a full
path (or a program tries to execute another program by name only)
and Windows can't find the program using its normal search path
it will look in the App Paths subkey. <SNIP>
----- End Original Message -----

And if you decide that App Paths is the way to go, as far as "a
dynamic way that I can load these paths"...

If... The applications only add (Default) and Path values
[unlike those such as the Internet Connection Manager
(cmmgr32.exe)]. If you have some knowledge of distributing
registry changes. And if you have, and are moderately proficient
in using, Microsoft Excel.

Then... One way you may be able to do this would be to export
and edit one App Paths registry key. Copy and paste the relevant
information into Excel as a template. Copy and paste your list
of application paths (that would need to include the application
name) into Excel. Use Excel's CONCATENATE worksheet function
(among other features such as Find and Replace) to create the
"guts" of the .reg file. Copy and paste the "guts" into Notepad.
Format the registry file's contents properly. Then use whatever
method desired to import the file into the registry of the target
computer(s).

For more information on the Excel concatenate function search its
help for the phrase "CONCATENATE worksheet function" and
read the topic by that title.

For more information about:

Distributing Registry Changes
By Kathy Ivens
From the April 2001 issue of Windows 2000 Magazine
http://www.microsoft.com/technet/prodtechnol/windows2000serv/maintain/operate/distreg.mspx

BTW, according to Microsoft Documentation you should only
add directories to the Path System Variable if you are absolutely
certain they are secure. For more information see the following:

Microsoft Server 2003 Enterprise Edition Documentation
Add or change the values of environment variables
http://www.microsoft.com/resources/...dard/proddocs/en-us/environment_variables.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top