Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I need to create a new environment variable and update an existing one using a batch file.
Any help will be highly appreciated..
Thanks and regards,
Shane

It is possible to create or modify environment variables using reg.exe(available in most xp machines not so sure about vista), there is however a catch, the variables aren't loaded until the next reboot(or possibly if another program broadcasts a WM_SETTINGSCHANGE, even then it won't be available to existing shells and is highly unlikely).
One of the keys is
HKEY_CURRENT_USER\Environmentor <userhive>\Environment
All of the global variables seem to be accessable from:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Values are the variable names and their data is what the variable expand to.

![]() |
Script works but misses a...
|
long folder names make fi...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |