Thanks David.
Perhaps you can tell me what is the directory name for Windows XP SP1 and
also for Windows Server 2003.
What I'm trying to do is to separate the system OS exec & dlls(from
Microsoft OS installation) and application exec&dlls(third party apps or MS
Apps). I'm yet to find the better way on how to separate those. Anyone has
any idea?
Perhaps I do not want to change the directory structure much but how do I
prevent any application installation that put its DLL and/or EXECUTABLE in
the<SystemDrive> \Windows or <SystemDrive>\Windows\System32 directory but
put them in their corresponding apps directory in the <SystemDrive>\Program
Files\<XYZ Application>\
Thanks.
There is no environmental variable. There is the new dll folder which is
where XP looks for dlls (with SP1 I think) but is a registry key.
Perhaps you should explain your problem and not ask questions about what you
think the solution is.
--
----------------------------------------------------------
'Not happy John! Defending our democracy',
http://www.smh.com.au/articles/2004/06/29/1088392635123.html
David Holcomb said:
What do you need all these new variables for? Are you trying to create a
custom PATH to determine the search path when launching a
binary? Is this a one-time need for the PATH(s)? Or are you trying to
set it globally for all eternity? Or just for the current
user?
I imagine it is usually best to try to stick with standard system
environment variables instead of trying to create your own custom
variables that will only work in your environment.
If you are using batch files you can write a subroutine which
"temporarily" sets the %PATH% environment variable (or any variable
name of your choosing) to include (i.e. append or prepend) some additonal
path you care about (using setlocal and endlocal to
establish the lifetime of when the custom path is valid). Using this
technique your script will be more portable across all Windows
machines, instead of requiring that it be run on a machine where a custom
%PFI%, %SRO%, or %S32% variable is set.
Your original question is "What would be the best way to set a bunch of
system-wide environment variables from a script instead of
GUI". Ricardo is right that one way is to use a for loop to enumerate all
pairs of variable names and values in a text file. You
can do the same thing in JScript or VBScript, or even perl if you have
access to perl. But in Windows you do require a program like
SETX.EXE to set an environment variable globally across all users or just
for the current user. This is because changing the system
environment variables globally requires a WM_SETTINGCHANGE message be
broadcast to all windows in order for the change to take
effect immediately. You can edit the appropriate registry keys, but the
change won't really take effect until you logoff and logon
or reboot the machine.
BTW, I have never heard of a "DLLPaths" variable for searching for DLLs,
at least not in the context of Windows environment
variables. It sounds familiar, though, as if I've heard about it
somewhere, perhaps related to some specific Windows API parameters