To avoid confusion with terminology used in domains on networks,
instead of 'local' say 'per user', and instead of 'global' say 'per machine' (for all local users).
'Local' really means 'on this machine only', and could mean for all local users.
Per machine variables are stored in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Per user variables are stored in
HKEY_CURRENT_USER\Environment
SETX can be per user or per machine.
SET is temporary (for the duration of the CMD session);
SETX is permanent (stored in the registry).
Variables set with SETX are not available in any CMD session that was open at the time it was set; it will be available in new CMD sessions.
To set a variable 'per Machine', use the /M option with SETX.
Example demo:
Enter this as Administrator:
C:\WINDOWS\system32>setx apps %SystemDrive%\apps /m
SUCCESS: Specified value was saved.
Then open another cmd window as a non-admin user:
C:\Users\jh>echo %apps%
C:\apps
Altough "apps" is machine-wide, %apps% gets the value for an ordinary user.
So the format "%ABC%" gets both user and machine variables.
To clear that variable, as admin, do setx apps "" /m
PATH
in an environment a 3rd party set up that I don't want to alter (in this case cmder). Of course I'm also asking for curiosity.