Tech Support > Microsoft Windows > Making Set Permanent
Making Set Permanent
Posted by IbarHarry on March 14th, 2006


I can use the SET command to set an environmental variable. However, as soon
as the bat file is exited the variable returns to the previous value. The set
command is acting like a SETLOC command. How can I make my settings remain
even after rebooting. It appears that a variable or setting in the security
section has to be changed. Does anyone know how to do this.

Posted by Mike Williams on March 14th, 2006


IbarHarry wrote:
Control Panel > System > Advanced [tab] > Environment Variables [button]

Posted by IbarHarry on March 14th, 2006




"Mike Williams" wrote:

The question is how to do so from a bat command file not from a manual
operation.

Posted by Mike Williams on March 14th, 2006


IbarHarry wrote:
I miss the old days of "I didn't phrase my original post well, but
thanks for trying.."

Posted by Doug Kanter on March 14th, 2006



"Mike Williams" <mikew@m-v-p-s.org.null> wrote in message
news:4417346F.90600@m-v-p-s.org.null...
Aren't the environment settings permanent after you enter them as you
suggested?



Posted by Pegasus \(MVP\) on March 14th, 2006



"IbarHarry" <IbarHarry@discussions.microsoft.com> wrote in message
news:EE9609A4-A48E-4789-A0CD-8D11DF3F99C9@microsoft.com...
Two choices:
- setx.exe (Windows Resource Kit)
- setenv (ftp://barnyard.syr.edu/pub/vefatica/setenv.exe)

Both commands will set an environmental variable for
***new*** processes but not for pre-existing ones.



Posted by David Candy on March 14th, 2006


How could they be? Every program gets their own environment, usually but doesn't have to be, a COPY of the process's environment that started them. Typing set has never made permanent changes to environment, not even in Dos.

--
--------------------------------------------------------------------------------------------------
Goodbye Web Diary
http://margokingston.typepad.com/har....html#comments
=================================================
"Doug Kanter" <ancientangler@hotmail.com> wrote in message news:_EGRf.17506$qg.13031@news01.roc.ny...

Posted by Doug Kanter on March 14th, 2006


I just wondered if that control panel thing functioned like an autoexec.bat
or config.sys file.


"David Candy" <.> wrote in message
news:eGpteM7RGHA.3972@TK2MSFTNGP10.phx.gbl...
How could they be? Every program gets their own environment, usually but
doesn't have to be, a COPY of the process's environment that started them.
Typing set has never made permanent changes to environment, not even in Dos.

--
--------------------------------------------------------------------------------------------------
Goodbye Web Diary
http://margokingston.typepad.com/har....html#comments
=================================================
"Doug Kanter" <ancientangler@hotmail.com> wrote in message
news:_EGRf.17506$qg.13031@news01.roc.ny...


Posted by David Candy on March 14th, 2006


Autoexec.bat works on XP. It is run AT USER LOGON. The first process gets a copy of the system's variables, processes it starts get it's COPY.

--
--------------------------------------------------------------------------------------------------
Goodbye Web Diary
http://margokingston.typepad.com/har....html#comments
=================================================
"Doug Kanter" <ancientangler@hotmail.com> wrote in message news:mdHRf.17511$qg.197@news01.roc.ny...

Posted by HeyBub on March 14th, 2006


IbarHarry wrote:
You've got it wrong. The settings do not revert simply by exiting a batch
file; they revert when the command sessions ends. In other words, the
settings are good only for the session. Setting them manually as suggested
below, however, makes them permanent and persistent, even across re-booting



Posted by IbarHarry on March 14th, 2006




"Pegasus (MVP)" wrote:

Posted by Pegasus \(MVP\) on March 14th, 2006



"IbarHarry" <IbarHarry@discussions.microsoft.com> wrote in message
news:5FA48DCE-A417-410F-BAFC-C07F281D52B6@microsoft.com...
remains set. Would the same be true for either setx.exe or setenv under XP?
Thanks and I look forward to your response. In reading it also seemed that a
flag is being set in the security section blocking the SET command from
retaining a value once a bat file has finished execution.

A simple test will demonstrate that both commands will work under WinXP.

You write "a flag is being set in the security section blocking the SET
command from retaining a value once a bat file has finished execution."
This is incorrect - there is no flag to block anything. A child process
inherits its environment from the parent process. When the child process
ends, its environment is discarded. That's all.



Posted by IbarHarry on March 15th, 2006




"Pegasus (MVP)" wrote:

The flag setting is mentioned in the MS documentation and I have actually
found the flag, but I don't know how to set it. I believe there actually is a
flag setting in the security section blocking the set command from working
and that's why the setx or setenv commands are talked about.

Posted by Pegasus \(MVP\) on March 15th, 2006



"IbarHarry" <IbarHarry@discussions.microsoft.com> wrote in message
news:50128FB6-B7D5-4A8E-B490-7AC23B07EE47@microsoft.com...
Please quote the MD documentation that discusses this flag, and
let us know where to find it.




Similar Posts