zoukankan      html  css  js  c++  java
  • windows-bat配置环境变量的几个坑点

    今天因为学校机房问题,想自动化安装vim,不料在编bat的时候不熟练,搞了很久。

    坑点1.%path%访问到的是用户的path,而不是系统的path。所以增加环境变量的时候只能增加用户的path。我就是因为增加了系统的path,弄了N个小时。

    坑点2:修改完环境变量后,必须进入GUI配置环境变量的地方,这样它才会更新。不然不会更新!!我就是没有注意到这一点,调试的时候莫名其妙。

    wmic ENVIRONMENT create name="curdisk",username="%computername%\%username%",VariableValue="C:" 
    wmic ENVIRONMENT create name="vimpath",username="%computername%\%username%",VariableValue="C:Program Files (x86)Vim" 
    wmic ENVIRONMENT create name="devcpppath",username="%computername%\%username%",VariableValue="C:Program Files (x86)Dev-Cpp" 
    
    echo 请打开一遍环境变量~
    pause
    
    wmic ENVIRONMENT where "name='Path' and UserName='%computername%\%username%'" set VariableValue="%path%%devcpppath%MinGW64in;%vimpath%Vim80;%vimpath%;%devcpppath%MinGW64x86_64-w64-mingw32in;"
    
    echo 请打开一遍环境变量,然后删掉多余的项~
    
    wmic ENVIRONMENT create name="LIBRARY_PATH",username="%computername%\%username%",VariableValue="%devcpppath%MinGW64lib32;%devcpppath%MinGW64x86_64-w64-mingw32lib32;" 
    
    wmic ENVIRONMENT create name="C_INCLUDE_PATH",username="%computername%\%username%",VariableValue="%devcpppath%MinGW64include;%devcpppath%MinGW64x86_64-w64-mingw32include;%devcpppath%MinGW64libgccx86_64-w64-mingw324.8.1include;" 
    
    wmic ENVIRONMENT create name="CPLUS_INCLUDE_PATH",username="%computername%\%username%",VariableValue="%devcpppath%MinGW64include;%devcpppath%MinGW64x86_64-w64-mingw32include;%devcpppath%MinGW64libgccx86_64-w64-mingw324.8.1include;%devcpppath%MinGW64libgccx86_64-w64-mingw324.8.1includec++;" 
    
    pause
  • 相关阅读:
    faster with MyISAM tables than with InnoDB or NDB tables
    w-BIG TABLE 1-toSMALLtable @-toMEMORY
    Indexing and Hashing
    MEMORY Storage Engine MEMORY Tables TEMPORARY TABLE max_heap_table_size
    controlling the variance of request response times and not just worrying about maximizing queries per second
    Variance
    Population Mean
    12.162s 1805.867s
    situations where MyISAM will be faster than InnoDB
    1920.154s 0.309s 30817
  • 原文地址:https://www.cnblogs.com/MyNameIsPc/p/7368294.html
Copyright © 2011-2022 走看看