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?)
Asked
Active
Viewed 4,276 times
1 Answers
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
-
nice! I suppose this also works for the domain users as well. Let me try this out – arthur Dec 09 '20 at 08:24