Re: set permanent env thru CLI

From: Matt Scarborough (vexversa_at_verizon.net)
Date: 06/11/03


Date: Wed, 11 Jun 2003 04:08:39 +0000


On Tue, 10 Jun 2003 12:03:28 -0700, Michael Whang wrote
<045f01c32f82$f9f98880$a101280a@phx.gbl>
> I need to change the environment variable on a remote
> machine that I am telnetting to, but the changes are not
> permanent. When I reboot the remote machine, the old
> environment is still active. Can anyone tell me how to
> make these changes permanent? Should i be using a switch
> i dont know about, or a command after I make the changes?

System environment variables are stored in
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
and require Administrator permissions to modify.

>From telnet

echo REGEDIT4 >C:\newenv.reg
echo. >>C:\newenv.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment] >>C:\newenv.reg
echo "NewValue"="value" >>C:\newenv.reg
echo. >>C:\newenv.reg

regedit /s C:\newenv.reg



Relevant Pages

  • Re: Subst question
    ... It is equivalent or == to Echo off. ... This will show you all environment variables. ... is this say if the OS is NOT Windows NTgo to logoff or IS Windows ...
    (microsoft.public.scripting.vbscript)
  • Re: Floating point exception
    ... Karl Voit wrote in message ... # script for execution of deployed applications ... echo Usage: ... echo Setting up environment variables ...
    (comp.soft-sys.matlab)
  • Re: Tips for using SED, or some other way to concatenate every other line of a file
    ... echo -n $LINE1>> FILE.txt ... echo $LINE2>> FILE.txt ... export or setenv in front of environment variables being defined to have ...
    (comp.os.linux.misc)
  • Re: VS Studio "Inventing" Odd Filepaths
    ... It may be that your environment variables are messed up (though ... USERPROFILE to be correct). ... echo %USERPROFILE% yields an empty string. ... and resets it by accident. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What are the other options against Zope?
    ... Instead of having separate .INI files scattered about. ... permanent than environment variables, and the centralization is better than INI files scattered about. ...
    (comp.lang.python)