Hi all,
I'm looking for a solution to edit/add/delete the master environment variables under Windows (any version). The api-call 'SetEnvironmentVariable' does not bring me the solution I need. Has anyone got a clue?
Thanks!
WizJos
Hi all,
I'm looking for a solution to edit/add/delete the master environment variables under Windows (any version). The api-call 'SetEnvironmentVariable' does not bring me the solution I need. Has anyone got a clue?
Thanks!
WizJos

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
Environment variables are used by many programs to read in additional information at startup. E.g. the PATH environment variable tells the shell where to look for executables, thus allowing you to run many programs without having to specify the full path of the binary.
Windows NT and its successors know two types of environment variables: System variables can be changed only by the administrator and affect all users, whereas user variables affect only the user who set them for his own environment. Both are set in the System applet of the System settings group. Select the "Environment" tab in the pop-up dialog and click on the entry that you want to edit. The present value of the variable will be displayed in a separate edit field. Change the value or append new values to the semicolon-separated list. Click Set (clicking OK alone is not sufficient). To create a new environment variable, enter a new name into the provided edit field, and set a value as described above.
On Windows 95/98/ME, all environment variables are set in the autoexec.bat file with an entry like set VARIABLE=VALUE. You will have to reboot the computer to let the changes take effect.
On Windows NT, click Windows-Pause/Break keys, on Sysem Properties window click Environment tab.
On Windows 2000/XP, click Windows-Pause/Break keys, on Sysem Properties window click Advanced tab, then Environment Variables button.
If you have a copy of reg.exe, you can also add system environment variables by editing the registry through a batch file as:
<hr>reg add "HKLMSYSTEMCurrentControlSetControlSession ManagerEnvironmentVarName=Value" %1<hr>
The postings on this site are my own and do not necessairly represent the position or opinion of WCNOC.