How to change environment variables in Windows 7

Anonim

How to change environment variables in Windows 7

The environment variable (environments) in Windows stores information on the settings of the OS and user data. It is denoted by the "%" pair symbol, for example:

% Username%

With these variables, you can transmit the necessary information to the operating system. For example,% Path% stores the list of directories in which Windows is looking for executable files if the path to them is not specifically specified. % Temp% stores temporary files, and% APPDATA% - user program settings.

Why edit variables

Changing environment variables can help if you want to transfer the TEMP or AppData folder to another place. Editing% Path% will give the ability to run programs from the "command line" without specifying every time a long path to the file. Let's consider the methods that will help in achieving these goals.

Method 1: Computer Properties

As an example, the program you want to run, use Skype. Having tried to activate this application from the "Command Line", you will get such a mistake:

Error starting skype on the command line in Windows 7

This is because you did not specify the full path to the executable file. In our case, the full way looks like this:

"C: \ Program Files (x86) \ Skype \ Phone \ Skype.exe"

Run Skype with the full path in the command line in Windows 7

To repeat it every time, let's add Skype directory into a variable% path%.

  1. In the "Start" menu, right-click on the "Computer" and select "Properties".
  2. Computer properties in windows 7

  3. Then go to "Advanced System Parameters".
  4. Additional system parameters in windows 7

  5. On the Optional tab, click on "Wednesday Variables".
  6. Menu Wednesday Variables in Windows 7

  7. A window with various variables will open. Select "PATH" and click "Change".
  8. Select a variable environment to edit in Windows 7

  9. Now you need to finish the path to our directory.

    The path must be specified not to the file itself, but to the folder in which it is located. Please note that the separator between directories is ";".

    We add the way:

    C: \ Program Files (x86) \ Skype \ Phone

    And click "OK".

  10. Saving changes in the environment variable in Windows 7

  11. If necessary, in the same way we make changes to other variables and click "OK".
  12. End of editing of the environment variable in windows 7

  13. Complete the user session so that the changes are preserved in the system. Go back to the "Command Line" and try to run Skype by typing
  14. Skype.

    Run Skype without full path in the command line in Windows 7

Ready! Now you can run any program, not just Skype, being in any directory in the "Command line".

Method 2: "Command Line"

Consider the case when we want to set% APPDATA% to the "D" disk. This variable is absent in "environment variables", so it cannot be changed in the first way.

  1. To find out the current value of the variable, in the "command prompt", enter:
  2. Echo% AppData%

    View AppData Values ​​on the command line in windows 7

    In our case, this folder is located at:

    C: \ Users \ Nastya \ APPDATA \ Roaming

  3. To change its value, enter:
  4. Set AppData = D: \ APPDATA

    Attention! Make sure you know exactly why you do it, because rampant actions can lead to WINDOVS inoperability.

  5. Check the current value of the% APPDATA% by entering:
  6. Echo% AppData%

    View the changed value of APPDATA on the command line in Windows 7

    The value is successfully changed.

Changing the values ​​of environment variables requires certain knowledge in this area. Do not play with the values ​​and do not edit them at random, so as not to harm the OS. Well study theoretical material, and only after that go to practice.

Read more