Get environment variable for current user and for all users in Python
I don't think you can figure it out using standard Python means like os.environ
. The only way to get user and system variables on Windows is to use registry, you can find more here:
HKEY_CURRENT_USER\Environment
System Variables
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
User variables
You need to access registry with Python to get them.