Change environment variables as standard user

134

48

When clicking on "Advanced system settings", I need to login as the administrator and hence only edit the administrators environment variables (in addition to the machine wide ones). How do I edit the environment variables of a standard user?

Details

With the migration to Windows 7, I decided to work as a standard user instead of an unprivileged administrator. Works well so far but I encountered a tiny problem:

When I try to change per user environment variables via the control panel I have to login as an administrator. But since I run that part of the control panel as the administrator I can only edit the administrators variables.

How am I supposed to edit my own environment variables? Without resorting to extreme measures, such as editing the registry (as suggested in "Is there any command line tool that can be used to edit environment variables in Windows?" )

SealedSun

Posted 2009-08-18T21:28:02.390

Reputation: 1 999

1

Refer solution provided here... http://stackoverflow.com/questions/8685699/windows-7-environment-variable-not-working-in-path/37507698#37507698 Quick tip: Use setx command

– Venkateswara Rao – 2016-05-29T08:25:30.727

Answers

179

Just type “environment” into the start menu (or press Win+S in Windows 10 and search for “Edit environment variables for your account”).

Similarly, searching for “environment” in the control panel yields that option, too.

Generally, I have noticed that simply searching for something in the start menu or control panel is much faster than trying to remember a series of icons, dialogs, etc. one has to access to find something. At least for the vast majority of tasks1.

A little digging yields that

rundll32 sysdm.cpl,EditEnvironmentVariables

is the command used to present that dialog. You can put a shortcut to that somewhere if you like.


1 There are exceptions, such as installing a loopback network adapter. I looked for a few minutes before finally finding how to do that. But those things are hardly common scenarios :-)

Joey

Posted 2009-08-18T21:28:02.390

Reputation: 36 381

2I could not find "environment" in either the start menu or Control Panel. But still the command line you posted worked well. Perhaps specific company restrictions were in place. – sancho.s Reinstate Monica – 2015-04-24T21:53:23.873

1You can check with set on the commandline if the changes you made are active. If not restarting the commandline should be enough to activate your changes to the environment values. – asmaier – 2015-08-27T13:10:54.313

1It should be noted that environment should be replaced with localized versions, at least in Windows 7. For example, in Russian Windows 7 you need to search for среды. – Alexandr Zarubkin – 2018-01-18T10:20:54.567

2Thanks! Being able to search the control panel is indeed one of the most useful features of Vista/7. Also thx for the rundll shortcut. – SealedSun – 2009-08-19T12:37:33.123

1This does not function for Admin users, right? I do not have that item. – Please_Dont_Bully_Me_SO_Lords – 2013-04-28T14:38:51.220

2awesome rundll shortcut man! – Kristof Feys – 2014-02-26T12:22:50.383

32

In addition to searching (as Johannes mentioned), "Change my environment variables" is listed under "Tasks" on the "User Accounts" control panel.

From the command line, you can create/modify persistent environment variables using the setx command, which is included in Windows Vista (and presumably Windows 7 too) and was part of the Windows Resource Kit Tools before that.

bk1e

Posted 2009-08-18T21:28:02.390

Reputation: 1 579

Careful when using setx to modify existing variables that may contain environment variable references. Those will usually be expanded by then and can sometimes result in overly long environment variables. I once ended up with a $Env:Path that was too long and new entries just never worked. – Joey – 2019-02-20T09:56:02.750

4+1 for setx. This might be the answer to the somewhat related question I posted in the question. – SealedSun – 2009-08-19T12:40:24.447

10

It is possible with the Rapid Environment Editor.

palacsint

Posted 2009-08-18T21:28:02.390

Reputation: 589

2Nice little utility. The path error checking is a nice bonus, as is the possibility to edit the environment variables for any user on your computer - far more handy then to fiddle in the registry directly. – parvus – 2013-10-03T05:21:45.060

7

In case you wish to edit an environment variable for a particular account but that variable is a part of system variables (which might be the case if you are setting path for a particular plugin) e.g. Path in Windows, you can achieve this by appending a semi-colon, if required, followed by %variable_value% like so:

Path=%Path%;c:\PathName\ForNewPlugin

bernard

Posted 2009-08-18T21:28:02.390

Reputation: 171