How do you set environment variables on Windows Server 2008 R2, specifically the PATH variable? The Microsoft Help source provides advice that doesn't match the screens and options I see on my server.
Windows Server 2008 R2 Environment Variables
environment-variableswindows-server-2008-r2
Related Solutions
The User and System paths are combined when users log in to the system. If no user is logged in, the %PATH% variable will reflect only the System path.
User variables are configured on a per-user basis, and only take effect when that particular user is logged in.
The System variable apply to all users on the system. The various Windows directories and the Java subsystem, plus others that should apply to all users, are set as part of the System path.
You shouldn't do this because it may not be supported by all programs. Just specify the full paths as most programs expect, and you should be fine.
There should be no XML in your %PATH% variables because the
<
and>
characters, which are used extensively in XML, are invalid directory variables.Some old DOS programs may have trouble with this, but I haven't experienced any problems with spaces in path elements since Windows XP. Just make sure that every path you specify that includes spaces in directory names is enclosed within quotation marks. The document you referenced, that recommends this practice, appears to be outdated as it discusses Java v1.5 (Java v1.6 has been available for many years now, and Java v1.7 is anticipated by many to be released very soon).
- Names are not always shortened to 8.3 with a ~1 suffix terminating the filename portion. For example, on 64-bit Windows you can type "Dir C:\PRO*" at a DOS prompt and you'll see at least two entries (typically "PROGRA~1" for "Program Files" and "PROGRA~2" for "Program Files (x86)").
Did you try hitting OK to close the main Environment Variables window too? I just tried and when I edit the path and hit OK to close the Edit window, it doesn't show up. When I then hit OK and close the Environment Variables window, it shows up (after closing any existing CMD windows and opening a new one).
FYI, be careful with the steps you listed though. I find that when I hit New, then click browse and select a path, it ends up overwriting the previous path on the list instead of adding a new one. I've been hitting New, then typing something like "x". Then clicking Browse while "x" is highlighted to select the path. This looks like a bug with the new path editor.
Best Answer
From the Server Manager console home page, you can click on Change System Properties on the right side.
Then click on the Advanced Tab, and the Environment Variables button...