A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to change PERMANENTLY environment variables from batch script?



 
 
Thread Tools Display Modes
  #1  
Old May 20th 10, 06:24 PM posted to microsoft.public.windowsxp.general,microsoft.public.windowsxp.help_and_support
Cindy Parker
external usenet poster
 
Posts: 33
Default How to change PERMANENTLY environment variables from batch script?

Ok, I know. In a batch file I can change environment variables temporarily (=for the
current, remaining session) be entering e.g.

set CLASSPATH=D:\newpath;%CLASSPATH%

However these changes are not visible outside of the current session and furthermore they
are lost after a reboot.

Is there a(nother) way to change them PERMANENTLY from batch script?

I can imagine that there is a way by a regedit or VisualBasic script or 3rd party cmdline tool.

Again: I don't want to edit them manually e.g. in the "System" dialog in control panel.
The change should take place on cmdline from a script

Cindy

Ads
  #2  
Old May 21st 10, 04:44 PM posted to microsoft.public.windowsxp.general
Ramu Soft
external usenet poster
 
Posts: 8
Default Try setx.exe

You can try setting env variable using setx.exe(a windows 2000 resource kit utility)

http://ss64.com/nt/setx.html

Alternate is to set the values directly in env variable registry key(HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment). If you have plans to use this alternate, test it well before you deploy it in large scale.

Hope this helps...





cyp wrote:

How to change PERMANENTLY environment variables from batch script?
20-May-10

Ok, I know. In a batch file I can change environment variables temporarily (=for the
current, remaining session) be entering e.g.

set CLASSPATH=D:\newpath;%CLASSPATH%

However these changes are not visible outside of the current session and furthermore they
are lost after a reboot.

Is there a(nother) way to change them PERMANENTLY from batch script?

I can imagine that there is a way by a regedit or VisualBasic script or 3rd party cmdline tool.

Again: I do not want to edit them manually e.g. in the "System" dialog in control panel.
The change should take place on cmdline from a script

Cindy

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Report Engine, Part 4
http://www.eggheadcafe.com/tutorials...ne-part-4.aspx
  #3  
Old May 21st 10, 04:50 PM posted to microsoft.public.windowsxp.general
Tom Willett[_2_]
external usenet poster
 
Posts: 530
Default Try setx.exe

Egghead Hooplehead alert. Changing the subject again to confuse people so
they wouldn't know to look at this thread for an answer to their original
question.

Ramu Soft wrote in message ...
: You can try setting env variable using setx.exe(a windows 2000 resource
kit utility)
:
: http://ss64.com/nt/setx.html
:
: Alternate is to set the values directly in env variable registry
key(HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment). If
you have plans to use this alternate, test it well before you deploy it in
large scale.
:
: Hope this helps...
:
:
:
:
:
: cyp wrote:
:
: How to change PERMANENTLY environment variables from batch script?
: 20-May-10
:
: Ok, I know. In a batch file I can change environment variables temporarily
(=for the
: current, remaining session) be entering e.g.
:
: set CLASSPATH=D:\newpath;%CLASSPATH%
:
: However these changes are not visible outside of the current session and
furthermore they
: are lost after a reboot.
:
: Is there a(nother) way to change them PERMANENTLY from batch script?
:
: I can imagine that there is a way by a regedit or VisualBasic script or
3rd party cmdline tool.
:
: Again: I do not want to edit them manually e.g. in the "System" dialog in
control panel.
: The change should take place on cmdline from a script
:
: Cindy
:
: Previous Posts In This Thread:
:
:
: Submitted via EggHeadCafe - Software Developer Portal of Choice
: WPF Report Engine, Part 4
:
http://www.eggheadcafe.com/tutorials...ne-part-4.aspx


  #4  
Old May 21st 10, 07:11 PM posted to microsoft.public.windowsxp.general
Billns
external usenet poster
 
Posts: 88
Default Try setx.exe

On 5/21/2010 8:50 AM, Tom Willett wrote:
Egghead Hooplehead alert. Changing the subject again to confuse people so
they wouldn't know to look at this thread for an answer to their original
question.

Ramu Soft wrote in message ...
: You can try setting env variable using setx.exe(a windows 2000 resource
kit utility)
:
: http://ss64.com/nt/setx.html
:
: Alternate is to set the values directly in env variable registry
key(HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment). If
you have plans to use this alternate, test it well before you deploy it in
large scale.
:
: Hope this helps...
:
:
:
:
:
: cyp wrote:
:
: How to change PERMANENTLY environment variables from batch script?
: 20-May-10
:
: Ok, I know. In a batch file I can change environment variables temporarily
(=for the
: current, remaining session) be entering e.g.
:
: set CLASSPATH=D:\newpath;%CLASSPATH%
:
: However these changes are not visible outside of the current session and
furthermore they
: are lost after a reboot.
:
: Is there a(nother) way to change them PERMANENTLY from batch script?
:
: I can imagine that there is a way by a regedit or VisualBasic script or
3rd party cmdline tool.
:
: Again: I do not want to edit them manually e.g. in the "System" dialog in
control panel.
: The change should take place on cmdline from a script
:
: Cindy
:
: Previous Posts In This Thread:
:
:
: Submitted via EggHeadCafe - Software Developer Portal of Choice
: WPF Report Engine, Part 4
:
http://www.eggheadcafe.com/tutorials...ne-part-4.aspx


Thunderbird, at least, seems to be able to keep this thread together
despite the name change in the subject line. I agree, though, that
posters shouldn't change the subject line.

Besides the setx suggestion the OP could run the batch file at startup
every time, although that's not what he asked.

Bill
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 07:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.