Setting environment variable for a different user in windows

There are tons of examples on the web how to set an environment variable for the current user. Is it possible to set an environment variable in windows for a different user (that does not have login rights?)


In the registry editor HKEY_CURRENT_USER is just an alias for the HKEY_USERS\$SID entry of the current user.

So, you only need to go to HKEY_USERS\$SID_OF_USER\Environment to set the variables there.

To get the SID of that user you can use this command:

wmic useraccount where name='username' get sid