Can windows does the below easily?

G

Guest

Guest
Archived from groups: microsoft.public.windows.server.general,microsoft.public.windows.server.scripting,microsoft.public.windowsxp.customize,microsoft.public.windowsxp.general (More info?)

What would be the best way to set a bunch of system-wide environment
variables(I have about 1000 lines) from a script instead of GUI?

I tried using 'setx /m' but it becomes to cumbersome.

e.g:

setx /M PFI="c:\Program Files"
setx /M SRO="%SystemRoot%"
setx /M S32="%SRO%\system32"

setx /M P0=%PFI%;%SR%;%S32%
....
etc,etc,etc...

Thanks
 
Archived from groups: microsoft.public.windows.server.general,microsoft.public.windows.server.scripting,microsoft.public.windowsxp.customize,microsoft.public.windowsxp.general (More info?)

Sarah Tanembaum wrote:
>
> What would be the best way to set a bunch of system-wide environment
> variables(I have about 1000 lines) from a script instead of GUI?
>
> I tried using 'setx /m' but it becomes to cumbersome.
>
> e.g:
>
> setx /M PFI="c:\Program Files"
> setx /M SRO="%SystemRoot%"
> setx /M S32="%SRO%\system32"
>
> setx /M P0=%PFI%;%SR%;%S32%
> ...
> etc,etc,etc...
>
> Thanks

Well, you should be able to parse a text file by using the 'for' command
and set these variables fairly easily. You may want to check in your
script, though, that the variable doesn't already exist, before changing
it.

hth
--
Ricardo M. Urbano
Microsoft Windows 2000/NT MVP
 
Archived from groups: microsoft.public.windowsxp.customize (More info?)

"Sarah Tanembaum" <sarahtanembaum@yahoo.com> wrote in message
news:2ovar5Ff3c0cU1@uni-berlin.de...
> Perhaps I exaggerated the number, but you get the idea for lots and lots
> of
> them depending on how many apps installed in the system.
>
> e.g: if each apps has 5-10 environment variable/registry setting, and you
> have 70 apps(big/small/medium) in the system.

In this day and age, it's rather unusual for the majority of applications to
create an environment variable, let alone 5-10. That's just something
developers should back away from.