Windows provide us with a Graphical User Interface (GUI) where we may supposedly see the environment variables available, which may be accessed at Config App > System > About > Advanced system settings.> Environment Variables. There we may see System and User environment variables.
Currently it show may the following user variables:
- Path
- TEMP
- TMP
- PATHEXT
- OneDrive
And the system variables bellow:
- ComSpec
- DriverData
- OS
- Path
- PATHEXT
- PROCESSOR_ARCHITECTURE
- PSModulePath
- TEMP
- TMP
- USERNAME
- windir
- NUMBER_OF_PROCESSORS
- PROCESSOR_LEVEL
- PROCESSOR_IDENTIFIER
- PROCESSOR_REVISION
Considering that an instance of CMD would receive a copy of the environment block of its parent process — which I suppose is initially Windows itself — I expected it to have an exact copy of those variables, and nothing more. However, when I run SET
command a lot more environment variables and not just the ones listed above.
The "extra" variables displayed:
- ALLUSERSPROFILE
- APPDATA
- CommonProgramFiles
- CommonProgramFiles(x86)
- CommonProgramW6432
- COMPUTERNAME
- FPS_BROWSER_APP_PROFILE_STRING
- FPS_BROWSER_USER_PROFILE_STRING
- HOMEDRIVE
- HOMEPATH
- LOCALAPPDATA
- LOGONSERVER
- ProgramData
- ProgramFiles
- ProgramFiles(x86)
- ProgramW6432
- PROMPT
- PUBLIC
- SESSIONNAME
- SystemDrive
- SystemRoot
- USERDOMAIN
- USERDOMAIN_ROAMINGPROFILE
- USERPROFILE
Why SET
command shows more variables than GUI does? Where comes the other environment variables listed by SET?