Preface
SETX is not a tool that comes with windows, it needs to be downloaded from Microsoft's website, but some systems will bring it. (provided by the official, can be assured to eat)
Both set and SETX can be used to configure environment variables. Their difference is that set is just a temporary modification of environment variables, the effect disappears after the console shuts down, and setx can permanently change the environment variable (the registry is automatically modified).
Download Link
Setx download (from CSDN): http://download.csdn.net/download/rpyoyo/2478379
can also use my download link (from the school computer room machine found, the system comes with): Http://files.cnblogs.com/files/yym2013/setx.rar
Code
The script is simple, just one line, but it avoids the hassle of manually adding system environment variables:
Python27 (32b)-autoconfig.bat
1 : : function: 2 :: Automatically configure Python directory to system variable path 3 :: 4 :: Precautions: 5 1 . Need and Setx.exe in the same directory 6 2 . Required is the default installation location 7 8 :: Add python directory to system variable path 9 " %path%; C:\python27"
Precautions
1. The script needs to be placed in the same directory as the Setx.exe file
2, Python needs to be the default installation location
3, This version only adapts to python2.7 (32 bit), other version of the self-modification installation directory location .
python3.5, for example, will
setx/m path "%path%; C:\python27 "
Modified to:
setx/m path "%path%; C:\python35 "
Setting environment variables for Java or other development environments is a good idea.
Reference Documents
HTTPS://TECHNET.MICROSOFT.COM/ZH-CN/LIBRARY/CC754250 (ws.10). aspx
Python environment variable automatic configuration script (Setx use)