Path Environment Variable

C

Chris

I have a utilities folder with a large amount of subfolders in it.
Each utility is in it's own folder because that is the easiest way to
manage the config files. I would like to add this utilities folder
recursively to the %path% variable, so that I may call them from the
command line, regardless of the current working directory. Is there
any way to accomplish this?

Thanks in advance,
Chris
 
P

Patrick Keenan

Chris said:
I have a utilities folder with a large amount of subfolders in it.
Each utility is in it's own folder because that is the easiest way to
manage the config files. I would like to add this utilities folder
recursively to the %path% variable, so that I may call them from the
command line, regardless of the current working directory. Is there
any way to accomplish this?

Thanks in advance,
Chris

You know about the environment settings page where you can edit the path?

Right-click on My Computer, choose Properties, Advanced, and the Environment
Variables button in the lower left.

HTH
-pk
 
C

Chris

Yes, I do, but doing it that way for close to 100 folders will prove
to be quite a tedious task. I could also write a script to do it
using the setx.exe tool, but then if I add another folder, that new
folder will not be included in the path. I'm looking for a way to add
my "...\Utils" folder and all it's subfolders to that path variable
such that if I add folders to that structure they are also added to
the path because they reside under the "...\Utils" directory.
 
A

Anteaus

This may help:

http://vlaurie.com/computers2/Articles/environment.htm#editing

which shows where this variable actually lives, in the registry.

AutoIt provides some effective registry-editing tools. Bear in mind the
caveat that the path value is a REG_EXPAND_SZ type, not an ordinary string.

http://autoitscript.com

The other point I would make is that having several hundred path values
might have unpredictble side-effects, like making file opens very slow. The
system AFAIK just isn't designed to cope with the likes of that.

An alternative which I myself use is to have a single 'batch' folder which
is in the path, and this contains shortcuts or batchfiles which launch the
utilities.
 
C

Chris

The shortcuts folder isn't a bad idea. I presume I would need to add
".lnk" to the PATHEXT variable to make it all work, but I could
probably rig a script to run and create shortcuts to all .exe files in
the utils directory.

Thanks for the help guys.
 

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