Just do:
SET
You can also do SET prefix to see all variables with names starting with prefix.
For example, if you want to read only derbydb from the environment variables, do the following:
set derby
...and you will get the following:
DERBY_HOME=c:\Users\amro-a\Desktop\db-derby-10.10.1.1-bin\db-derby-10.10.1.1-bin
Answer from Jon on Stack OverflowELI5: What are environment variables on Windows ?
Please help me understand the purpose of environments in PowerShell
Environment Variable inside a single '
Environment variables (Windows and WSL) ?
Videos
Just do:
SET
You can also do SET prefix to see all variables with names starting with prefix.
For example, if you want to read only derbydb from the environment variables, do the following:
set derby
...and you will get the following:
DERBY_HOME=c:\Users\amro-a\Desktop\db-derby-10.10.1.1-bin\db-derby-10.10.1.1-bin
Jon has the right answer, but to elaborate a little more with some syntactic sugar..
SET | more
enables you to see the variables one page at a time, rather than the whole lot, or
SET > output.txt
sends the output to a file output.txt which you can open in Notepad or whatever...
In Windows Command-Prompt the syntax is echo %PATH%
To get a list of all environment variables enter the command set without any parameters.
To send those variables to a text file enter the command set > filename.txt
Related
- How to list global environment variables separately from user-specific environment variables?
To complement the previous answer, if you're using Powershell echo %PATH% would not work. You need to use the following command instead: echo $Env:PATH
Microsoft's Command Shell Overview gives a detailed description of where/how variables are stored.
The punchline is that User vars are stored in HKCU\Environment, and System vars are in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.
Not sure where it was set from, but I was able to get rid of it by setting it in System Properties->Advanced->Environment Variables to "c:\". I then could select it from the list and click delete. Afterward it was gone from my command prompt.