Making Set Permanent

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
IbarHarry said:
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.

Control Panel > System > Advanced [tab] > Environment Variables [button]
 
The question is how to do so from a bat command file not from a manual
operation.
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.

Control Panel > System > Advanced [tab] > Environment Variables [button]
 
IbarHarry said:
The question is how to do so from a bat command file not from a manual
operation.
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.
Control Panel > System > Advanced [tab] > Environment Variables [button]

I miss the old days of "I didn't phrase my original post well, but
thanks for trying.."
 
Mike Williams said:
IbarHarry said:
Mike Williams said:
IbarHarry wrote:
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

The question is how to do so from a bat command file not from a manual
operation.
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.
Control Panel > System > Advanced [tab] > Environment Variables [button]

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

Aren't the environment settings permanent after you enter them as you
suggested?
 
IbarHarry said:
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.

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.
 
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/harry_version_2/2005/12/thank_you_and_g.html#comments
=================================================
Doug Kanter said:
Mike Williams said:
IbarHarry said:
:

IbarHarry wrote:
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

The question is how to do so from a bat command file not from a manual
operation.
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.
Control Panel > System > Advanced [tab] > Environment Variables [button]

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

Aren't the environment settings permanent after you enter them as you
suggested?
 
I just wondered if that control panel thing functioned like an autoexec.bat
or config.sys file.


"David Candy" <.> wrote in message
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/harry_version_2/2005/12/thank_you_and_g.html#comments
=================================================
Doug Kanter said:
Mike Williams said:
IbarHarry said:
:

IbarHarry wrote:
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

The question is how to do so from a bat command file not from a manual
operation.
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.
Control Panel > System > Advanced [tab] > Environment Variables
[button]

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

Aren't the environment settings permanent after you enter them as you
suggested?
 
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/harry_version_2/2005/12/thank_you_and_g.html#comments
=================================================
Doug Kanter said:
I just wondered if that control panel thing functioned like an autoexec.bat
or config.sys file.


"David Candy" <.> wrote in message
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/harry_version_2/2005/12/thank_you_and_g.html#comments
=================================================
Doug Kanter said:
Mike Williams said:
IbarHarry wrote:

:

IbarHarry wrote:
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

The question is how to do so from a bat command file not from a manual
operation.
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.
Control Panel > System > Advanced [tab] > Environment Variables
[button]


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

Aren't the environment settings permanent after you enter them as you
suggested?
 
IbarHarry said:
The question is how to do so from a bat command file not from a manual
operation.

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
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.

Control Panel > System > Advanced [tab] > Environment Variables
[button]
 
Pegasus (MVP) said:
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.


I saw the setx, but it seems to be associated with 2000. Will it work under XP. Under 98 SE you can SET a variable at Startup in a Bat file and it 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.
 
under XP. Under 98 SE you can SET a variable at Startup in a Bat file and it
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.
 
Pegasus (MVP) said:
under XP. Under 98 SE you can SET a variable at Startup in a Bat file and it
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.

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.
 
IbarHarry said:
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.

Please quote the MD documentation that discusses this flag, and
let us know where to find it.
 
Back
Top