How to set user environment variables in Windows Server 2008 R2 as a regular user?

In older versions of Windows, he simply opened the control panel, select the system applet, go to the "Advanced" tab, and then click the "Environment Variables" button. As a regular user, you can edit "User Variables" but not "System Variables".

In Windows Server 2008 R2, if I try to use the Advanced System Settings option in the System applet, it asks for an administrator password.

+67
windows environment-variables windows-server-2008
Sep 29 '09 at 13:59
source share
8 answers

You can also use this direct command line to open advanced system properties:

sysdm.cpl 

Then go to the Advanced tab → Environment Variables

+82
Jun 16 2018-11-11T00:
source share

OK, I found it. Arg, exercise in frustration. They left the path of the old window to change the environment variables there, but limited access only to administrators. As a regular user, if you want to change it, you need to go through a different set of parameters in order to get to the same frigate window.

Control PanelUser AccountsUser AccountsChange my environment variables.

+64
Sep 29 '09 at 14:53
source share

Step by step instructions:

  • Go to Control Panel \ System and Security \ System
  • Click "Change Settings"
  • Click the Preview tab.
  • Click "Environment Variables"
+21
Jun 08 2018-10-10T00:
source share

In the "Start" section, enter "environment" in the search field. This list will indicate the ability to change system variables directly in the Start menu.

+5
May 9 '11 at 9:46 am
source share

This can be done from the command line using the SETX . For example, to “move” your temporary files to another drive:

 SETX TEMP d:\tmp 
+3
May 31 '13 at 13:59
source share

At the command line:

 set __COMPAT_LAYER=RUNASINVOKER SystemPropertiesAdvanced.exe 

Now you can set user environment variables.

+2
Apr 20 '14 at 18:13
source share

I created a godmode folder on the desktop. just create a new folder on your desktop and name it GodMode. {ED7BA470-8E54-465E-825C-99712043E01C} it will name the folder as godmode and fill the content with various configuration parameters, you can simply enter ENVIRO in the search to find the corresponding configuration parameter, open it and open sysdm.cpl in the "Advanced" tab, you can change the environment variables from there.

+2
Oct 22 '14 at 10:45
source share

There are three ways.

1) Launches a graphical editor for user environment variables. It does exactly what the OP wanted to do, and does not ask for administrator credentials.

 rundll32.exe sysdm.cpl,EditEnvironmentVariables 

(bonus: this works from Windows Vista to Windows 10 for desktop computers and from Windows Server 2008 to Server 2016. This does not work on Windows NT, 2000, XP, and 2003. However, on older systems you can use sysdm.cpl without "EditEnvironmentVariables" , then go to the "Advanced" tab and click the "Environment Variables" button.)

2) Use the SETX command from the command line. This is similar to the set command, but it updates the environment that is stored in the registry. Unfortunately, SETX is not as easy to use as the built-in SET command. There is no way to list variables, for example. Thus, it is impossible to do something, for example, add a folder to a user PATH variable. While SET will display variables, you do not know which of them are user or system variables, and the displayed PATH is a combination of both.

3) Use regedit and go to HKEY_CURRENT_USER \ Environment

Remember that changes in the user environment do not immediately apply to all processes that are currently running for this user. You can see this on the command line, where your changes will not be visible if you use SET. for example

 rem Add a user environment variable named stackoverflow that set to "test" setx stackoverflow test set st 

This should show all variables whose names begin with the letters "st". If not, " Environment variable st not defined " is displayed. Exit the command prompt and run another. Try to set st times and you will see

 stackoverflow=test 

To remove the stackoverflow variable, use

 setx stackoverflow "" 

It will reply “ SUCCESS: Specified value was saved. ”, Which looks strange if you want to remove the variable. However, if you run a new command line, then set st will show that there are no variables starting with the letters "st"

(correction - I found that setx stackoverflow "" does not delete its variable in the registry as an empty string .. SET command, although it interprets it as if there was no variable. if not defined stackoverflow echo Not defined says that it is not defined.)

0
Jul 13 '19 at 1:57
source share



All Articles