0

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?)

arthur
  • 177
  • 2
  • 8

1 Answers1

2

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
Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89