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.

Answer from MC10 on Stack Exchange
🌐
Windows 10 Forums
tenforums.com › tutorials › 3234-environment-variables-windows-10-a.html
Environment Variables in Windows 10 - Windows 10 Help Forums
December 11, 2014 - The variable (ex: "%UserProfile%") ... for all users). This tutorial will show you a complete list of default environment variables that can be used to reference standard directories and parameters in Windows 10....
🌐
Computer Hope
computerhope.com › issues › ch000088.htm
What Are the Default Environment Variables in Windows?
June 1, 2025 - The default environment variables in Microsoft Windows XP, Vista, 7, 8, 10, and 11, their paths, and functionalities essential for users and administrators.
Discussions

Are these Environment Variables ok? Is there a "default"?
The PATH environment variable is OK since it is used to let you open system programs from anywhere under terminals More on reddit.com
🌐 r/Windows10
3
2
May 10, 2024
cmd - Permanently Change Environment Variables in Windows - Stack Overflow
Note that the article was originally ... current Windows versions. ... It doesnt really explain how to permanently change the variables, it says stuff about group permissions but no actual instructions, any chance to explain further? 2012-08-13T04:56:40.363Z+00:00 ... Sorry, no not really - as I said I never tried it. This might or might not help. 2012-08-13T05:10:25.313Z+00:00 ... Back in the days of DOS the environment variables ... More on stackoverflow.com
🌐 stackoverflow.com
Is there anyway to use the default environment variables, like %USERPROFILE%, for a reference file?
I have a bat file I set up for users in my company to open a database. It downloads a copy of the front end from a network folder to a folder I set in their Documents folder using the %USERPROFILE% environment variable. It then runs that copy. I do… More on learn.microsoft.com
🌐 learn.microsoft.com
7
0
May 10, 2025
How do I edit environment variables in windows 10
  • Window Key + X

  • System

  • Advanced system settings

  • Environment Variables...

More on reddit.com
🌐 r/Windows10
5
0
August 20, 2015
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › deployment › usmt › usmt-recognized-environment-variables
Recognized environment variables | Microsoft Learn
Applies to: ✅ Windows 11, ✅ Windows 10 · Feedback · Summarize this article for me · When the XML files MigDocs.xml, MigApp.xml, and MigUser.xml are used, the environment variables can be used to identify folders that can be different on different computers.
🌐
GitHub
gist.github.com › krabs-github › 02a56465024c0797c67d2ffaefdd7a98
Windows 10+ default environment variables - Gist - GitHub
[Windows Variables] Windows Variables #Windows. GitHub Gist: instantly share code, notes, and snippets.
Top answer
1 of 9
179

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.

2 of 9
127

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(!).

🌐
Reddit
reddit.com › r/windows10 › are these environment variables ok? is there a "default"?
r/Windows10 on Reddit: Are these Environment Variables ok? Is there a "default"?
May 10, 2024 -

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

Find elsewhere
🌐
Pureinfotech
pureinfotech.com › home › complete list of environment variables on windows 10, 11
Complete list of environment variables on Windows 10, 11 - Pureinfotech
August 14, 2023 - Or you can use the “%HOMEPATH%” ... user’s default profile folder location (where the system stores the folders for Desktop, Documents, Downloads, and OneDrive). This guide will teach you the list of the most common environment variables you can use on Windows 11 (and on Windows 10)...
🌐
Quora
quora.com › How-do-I-reset-the-default-environment-variables-in-Windows-10
How to reset the default environment variables in Windows 10 - Quora
For complex enterprise environments, consult your IT group or deployment images. If the goal is to revert to a known factory state and manual edits are insufficient, restoring a system image or performing a Windows Reset (Settings → Update & Security → Recovery → Reset this PC) will return variables to defaults but is a heavier option.
Top answer
1 of 7
12

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.

2 of 7
7

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.

🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 5455512 › is-there-anyway-to-use-the-default-environment-var
Is there anyway to use the default environment variables, like %USERPROFILE%, for a reference file? - Microsoft Q&A
May 10, 2025 - I have a bat file I set up for users in my company to open a database. It downloads a copy of the front end from a network folder to a folder I set in their Documents folder using the %USERPROFILE% environment variable. It then runs that copy. I do…
🌐
Eleven Forum
elevenforum.com › windows support forums › tutorials
Complete List of Environment Variables in Windows 11 | Windows 11 Forum
November 20, 2024 - This tutorial will show you a complete list of default environment variables that can be used to reference standard directories and parameters in Windows 10 and Windows 11. Environment variables are a set of dynamic named values that can affect the way running processes will behave on a...
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to set environment variable in windows
How to Set Environment Variables in Windows
December 9, 2025 - When you add an environment variable in Windows, the key-value pair is saved in the registry. The default registry folders for environment variables are:
🌐
How-To Geek
howtogeek.com › home › windows › how to edit environment variables on windows 11
How to Edit Environment Variables on Windows 10 or 11
September 23, 2025 - By default, Path only points to a few Windows folders, but you can easily add more. Changing environment variables can result in your PC malfunctioning. If you're going to add, edit, or delete an environment variable, be sure to double-check what it is you're doing. There are some minor differences between the user interfaces of Windows 10 ...
🌐
Oracle
java.com › en › download › help › path.html
How do I set or change the PATH system variable?
Making changes to the system PATH variable is typically not necessary for computers running Windows or Mac OS X. In Search, search for and then select: System (Control Panel) Click the Advanced system settings link. Click Environment Variables. In the section System Variables find the PATH ...