Note: After seeing lots of comments about setting environment variables without administrator rights in Windows 10, I think I have found a way. I was not administrator and could use PowerShell.
PowerShell method
You can list all environment variables with: Get-ChildItem Env:.
To get the value of a specific variable: $Env:PATH, where PATH is the name of the variable.
To set a variable: [Environment]::SetEnvironmentVariable("PATH", "C:\TestPath", "User"), the first parameter is the name of the variable, the second is the value, the third is the level of.
There are different ways to work with environment variables and certain quirks with them in PowerShell so consult the link for details.
Old method (no longer available in newer Windows 10 updates, use PowerShell or see other answers)
Go into Settings and click on System.

Then on the left side click About and select System info at the bottom.

In the new Control Panel window that opens, click Advanced system settings on the left.

Now in the new window that comes up, select Environment Variables... at the bottom.

Are these Environment Variables ok? Is there a "default"?
cmd - Permanently Change Environment Variables in Windows - Stack Overflow
Is there anyway to use the default environment variables, like %USERPROFILE%, for a reference file?
How do I edit environment variables in windows 10
-
Window Key + X
-
System
-
Advanced system settings
-
Environment Variables...
Videos
Note: After seeing lots of comments about setting environment variables without administrator rights in Windows 10, I think I have found a way. I was not administrator and could use PowerShell.
PowerShell method
You can list all environment variables with: Get-ChildItem Env:.
To get the value of a specific variable: $Env:PATH, where PATH is the name of the variable.
To set a variable: [Environment]::SetEnvironmentVariable("PATH", "C:\TestPath", "User"), the first parameter is the name of the variable, the second is the value, the third is the level of.
There are different ways to work with environment variables and certain quirks with them in PowerShell so consult the link for details.
Old method (no longer available in newer Windows 10 updates, use PowerShell or see other answers)
Go into Settings and click on System.

Then on the left side click About and select System info at the bottom.

In the new Control Panel window that opens, click Advanced system settings on the left.

Now in the new window that comes up, select Environment Variables... at the bottom.

Still the same as ever: It’s in the old-style control panel’s “System” thingy. You can reach it with WinBreak or by right-clicking the Start button.
From there, select “Advanced system settings” → “Environment Variables”.
Or you can do it the hard way and find some other entry point to the old-style control panel, like the Network and Sharing Center or the Desktop folder(!).
I was looking at the Default Environment Variables (from Advanced System settings) and came across them here. I was wondering if these were correct/looked right to anyone. I was mainly thrown off by the ones in the Path line under the System variables section, as there are more than one and they're mostly System32 related until the last one where it throws the HP One Agent filepath in there.
Screenshot: https://i.imgur.com/ZgHtaw5.png
Nowhere does it mention a dependency between the HOMEDRIVE value and the HOMEDIRECTORY value, what was happening (I think) is that it was failing to map the home directory to the HOMEDRIVE and therefore defaulting back to a safe value (C:)
I wrote a script to update the local AD, replace the values in [] with your values. Copy and paste into a .vbs file and double click on it to run it.
Set objUser = GetObject("WinNT://[COMPUTERNAME]/[USERNAME],user")
objUser.homeDirDrive = "H:"
objUser.HomeDirectory = "[URNPATH]"
objUser.SetInfo
e.g.
Set objUser = GetObject("WinNT://UQBDART-2328/BEN,user")
objUser.homeDirDrive = "H:"
objUser.HomeDirectory = "\\SERVER\SHARE"
objUser.SetInfo
run this, reboot and test. It worked for me.
Sounds like the AD profile on the domain is overwriting the user defined variables. I see your screenshot says you are connected to the eait.org.edu.au domain. That will be the root of your issue. Just to include some details here that I spotted elsewhere, that may be of help to you:
HOMEDRIVE, HOMEPATH & HOMESHARE are set and updated via Active Directory. HOMEDRIVE & HOMEPATH are set even without a home drive set on the account; however they will be overridden by any user account properties set in AD.
Also see these KB articles:
http://support.microsoft.com/kb/841343 (archived)
http://support.microsoft.com/kb/237566
http://support.microsoft.com/kb/101507 (archived)
On a side-note for another way around the issue:
-I have in the past created a new instance of the windows command-line shell executable that automatically runs a custom script, so everytime you launch the shell, the environment variable could be overriden.
-To do that you could just put the code you posted to change the environment variable into a batch script, stored wherever you like, then edit the shortcut(s) used to launch the shell by going to properties > then alter the Target box: %SystemRoot%\system32\cmd.exe /K "C:\Documents and Settings\Administrator\My Documents\customshellscript.cmd" (Obviously the part of the path after /K is the location of your custom script)
This way, if you are using openSSH over the console anyway, it will always have the homedrive set correctly.
You can always invoke a cmd shell with administrator rights (or any other runas method), and use a tool such as SETX to modify the path permanently. Existing shells and/or running programs will probably be using the old path, but any new shell/program will use the new settings.
For accounts without admin privileges:
Open "User Accounts" and choose "Change my environment variables" (http://support.microsoft.com/kb/931715).
This dialog will show you your current user variables as well as the system variables. You may need to add a local PATH variable if you haven't already.
To update your Path to include the Python 3.3 directory, for instance, click New:
Variable Name: PATH Variable Value: %PATH%;C:\Python33
This creates a local PATH by taking the current system PATH and adding to it.
I need to add JAVA_HOME to my variables and put the java command in my PATH. How do I edit environment variables in window 10?
Courtesy of u/willam_tropico, the solution is:
-
Window Key + X
-
System
-
Advanced system settings
-
Environment Variables...
-
Window Key + X
-
System
-
Advanced system settings
-
Environment Variables...
If you're editing the User Variables only:
Press Win+R, and type (copy/paste) & enter:
rundll32.exe sysdm.cpl,EditEnvironmentVariables
But, you are editing/adding to the path, so you need System access. System access requires administrator privileges.
So, press, Win+X, then the A key, for admin command window. Then type (copy/paste) & enter:
rundll32.exe sysdm.cpl,EditEnvironmentVariables
Under System Variables, click New.
Enter the variable name as JAVA_HOME.
Enter the variable value as the installation path for the Java Development Kit.
Click OK.
Click Apply Changes.
A restart may be required.
The SYSTEM variables are those stored in:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
The <DEFAULT> variables are those stored in:
HKEY_USERS\.DEFAULT\Environment
The .DEFAULT user is not the default settings that are created when a user's profile is created for the first time. Rather, .DEFAULT is the HKEY_CURRENT_USER environment used by the LocalSystem security context.
Here's some background from Raymond Chen's blog to give my answer some addt'l credibility: http://blogs.msdn.com/oldnewthing/archive/2007/03/02/1786493.aspx >smile<
I'm not quite sure on this one, but most likely the system variables will be available all the time, wherease the Default User variables only apply as long as the user has not overwritten them.
My freshly installed Windows 8.1 has the following value in PATH:
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
%JAVA_HOME%\bin;C:\oraclexe\app\oracle\product\11.2.0\server\bin;%ANT_HOME\bin;%JAVA_HOME%\bin;C:\Oracle\bin;C:\Informatica\9.1.0\DataTransformation\bin;C:\Informatica\9.1.0\clients\tools\datadirect;C:\Informatica\9.1.0\clients\DeveloperClient\bin;C:\Informatica\9.1.0\clients\java\jre\bin\server;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Lenovo;C:\Program Files (x86)\Perforce;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\Lenovo\Access Connections\;C:\Program Files (x86)\Git\cmd
This is mine, I think you modify it based on the software you installed.