Where are the paths %systemroot% stored.


I would like to ask where in Windows (Windows 10 preferably) are the path %systemroot% (links in the percentages kept).

For example if I wanted to create a path for example %test% to point to a specific folder so that it can be found in file explorer using the %test%

How would I do this in steps please.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

User environment variables are stored in the registry key below:


System environment variables are stored in the registry key below:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

You can open a command prompt, type the command "set", and press the Enter key to display all current environment variables on your PC.

You can also open PowerShell, type Get-ChildItem Env:, and press the Enter key to display all current environment variables on your PC.

Or, you could go the GUI method: Control Panel → System and Security → System → Advanced system settings → Environment variables to add the %test% variable.
AcentriaAuthor Commented:
Thanks netcmh, what would be the the path I would need to insert into the Env Variable in Advanced System please?
Just add a new variable. Use any descriptive name and give it the complete path in the Variable Value.
You could use the setx command to accomplish the same from CLI:

SETX test "c:\test"

echo %test%

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Thanks for the grade. Good luck.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.