How do you avoid over-populating the PATH Environment Variable in Windows?

前端 未结 12 1006
慢半拍i
慢半拍i 2020-11-30 16:26

I would like to know what are the approaches that you use to manage the executables in your system. For example I have almost everything accessible through the command line,

12条回答
  •  自闭症患者
    2020-11-30 17:00

    In case anyone's interested...

    I find I never really need all those paths at once, so I create a bunch of "initialization" batch files which modify the path accordingly.

    For example, if I wanted to do some C++ development in Eclipse, I would do:

    > initmingw
    > initeclipse
    > eclipse
    

    This is also handy for avoiding conflicts between executables with the same name (such as the C++ and D compilers, which both have a make.exe).

    My batch files typically look like this:

    @echo off
    set PATH=C:\Path\To\My\Stuff1;%PATH%
    set PATH=C:\Path\To\My\Stuff2;%PATH%
    

    I find this approach relatively clean and have yet to run into any problems with it.

提交回复
热议问题