Actions for environment variables under windows

Source: Internet
Author: User

How to view, modify, delete, and add environment variables on the cmd command line: First, make it clear:
All changes to the environment variable under the CMD command line are valid only for the current window, not for permanent modification. This means that when this cmd command-line window is closed, it will no longer work.
There are two ways to permanently modify environment variables: One is to modify the registry directly (this method has not been tested at this time), and the other is to set the system's environment variables (see details) by using My Computer-Properties-〉 advanced. Second, clarify the role of environmental variables. It is a parameter that the operating system uses to specify the running environment. such as temporary folder location and System folder location. When you run some programs, in addition to looking in the current folder, but also to these environment variables to find, such as "Path" is a variable, which stores some common commands stored in the directory path. Third: Under what circumstances are settings made? When the cmd Command Line window to invoke a command, often "XXX is not an internal or external command, or a running program or batch file", if your spelling is not wrong, and the computer does exist in this program, then the hint is that your PATH variable is not set correctly, Because your path, also is the default path does not have your program, and you have not given the absolute path of your program (because you just entered the name of the command or program), this is the operating system do not know where to find your program, it will prompt this problem. IV: How to modify? 1. View all currently available environment variables: Enter set to view. 2. View an environment variable: input?? " Set variable name "Can, for example, want to see the value of the path variable, that is, enter set PATH3, modify environment variables?" : Enter "Set Variable name = variable content", such as set path to "D:\nmake.exe", as long as you enter set Path= "D:\nmake.exe". Note that this modified environment variable refers to the current content to overwrite the previous content, not append. For example, when I set the path above, if I re-enter set path= "C" again, when I look at the path, the value is "C:" instead of "D:\nmake.exe"; "C". 4. Set to NULL: If you want to set a variable to NULL, enter "Set Variable name =". If "Set path=" then look at the path is empty. Note that the above has been said to work only in the current command-line window. So do not right-click on "My Computer"-"Properties" ... 5. Append content to variable (different from 3, that is overwrite): enter "Set variable name =% variable name%; variable Contents". For example, to add a new path for path, enter "Set path=%path%;d: \nmake.exe" to add D:\nmake.exe to path and execute "set Path=%path%;c:" Again, then use the set Path statement to view, there will be: d:\nmake.exe;c: Instead of just C: in the 3rd step. Appendix: The following are some common environment variables and the role of%allusersprofile% local return all "user profile" bitsReset %appdata% Local returns the location by default where the application stores data. %cd% returns the current directory string locally. %cmdcmdline% Local returns the exact command line used to start the current Cmd.exe. The%cmdextversion% system returns the version number of the current command handler extension. The%computername% system returns the name of the computer. The%comspec% system returns the exact path to the command-line interpreter executable program. The%date% system returns the current date. Use the same format as the date/t command. Generated by Cmd.exe. For more information about the date command, see Date. The%errorlevel% system returns the error code for the most recently used command. Errors are usually indicated by a value other than 0. The%homedrive% system returns the local workstation drive letter that is connected to the user's home directory. Settings based on the home directory value. The user home directory is specified in Local Users and groups. The%homepath% system returns the full path of the user's home directory. Settings based on the home directory value. The user home directory is specified in Local Users and groups. The%homeshare% system returns the network path of the user's shared home directory. Settings based on the home directory value. The user home directory is specified in Local Users and groups. %logonsever% Local returns the name of the domain controller that validates the current logon session. The%number_of_processors% system specifies the number of processors installed on the computer. The%os% system returns the name of the operating system.


Http://zhidao.baidu.com/link?url= opedu7ray2xcpslb8gplby6wwut5rxdrdfvebndvanr92-sz1y91vwvcxz7bcnnki66wqivxj5wdrjtojumc72hjionbzp2gq7yvtvpp99e

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.