How to modify environment variables in Windows 7 and do not need to restart your computer

Source: Internet
Author: User

First, go to my computer> Properties> advanced> environment variables, add new environment variables or modify existing environment variables, and then run "doscommand prompt" or run cmd. If you want to modify the PATH variable, no matter what the original value of path is, change the path to any value in the DOS window and close the DOS window, my computer> Properties> advanced> environment variable path has taken effect globally in windows.

Do not worry that changes in the DOS window will affect my computer> Properties> advanced> environment variables. The environment variables in the DOS window are only a copy of the Windows environment variables, changes to the copy will not affect the original, but will trigger the refresh of the original, which is exactly what I want-to make the environment variable take effect.

Note:

Do not know how to modify environment variables in DOS? It is very simple. For example, to modify the path, "set Path = c: \", there should be no spaces on both sides of the equal sign. PATH environment variables are the most commonly used. Specifically, there is a doscommand path used to view and modify the PATH value. Here we will not expand the path syntax.

Want to verify whether the environment variable has taken effect? Very simple. Open a new DOS window, for example, to view the PATH value, "Echo % PATH % ". Similarly, you can use the path command to view the path.

I often see some software installation instructions that modify the Windows environment variables and restart the computer. This raises questions. Do I have to restart the environment variable after modification? In fact, you only need to understand the principles of environment variables to make correct judgments. Environment variables are system variables that are valid for any Program . The simplest confirmation method is the cmd.exe program. Click Start> Run, Enter cmd, press enter, and enter set in the startup command line window, then we can see a bunch of various environment variables displayed on the screen. The environment variables are modified through the "control panel"-> "System"-> "advanced"-> "environment variables" dialog box. It should be understood that when a program is started, the environment variables are copied to the environment where the program is located and will not be changed by other programs except the program during execution. That is to say, if we start a cmd program and then modify the environment variable settings through the control panel, the environment variables of the started cmd will not be changed. If we start the CMD program after modifying the environment variable, the program will have a new environment variable. The conclusion is obvious: After modifying the environment variable, if the affected application is affected, simply restart the application, changes to environment variables will be reflected in the program without restarting the computer. However, if the system service is affected, you must restart the system to reflect the changes to the environment variables to the System Service (because there is no way to restart the system service manager without restarting the computer ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.