2

As far as i know, the user variables (of the currently logged on user) are stored in HKEY_CURRENT_USER\Environment. User path variables are stored in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders and the system variables are stored in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. Thanks to this source

I am trying to read the environment variable %APPDATA% of all existing users. My python script is getting executed with system rights.

It is possible to read environment variables using os.environ(). But i did not find any documentation, which environment variables are read (the current logged on user variables or the system variables).

So is it possible to read the user path variables of all existing users?

Thanks for any help!

1 Answer 1

1

The registry key/value you need is:

Key: HKEY_USERS\[SID]\Volatile Environment\ Value: AppData 

So you would need to iterate through all of the currently loaded hives in HKEY_USERS for each SID.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.