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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|