Windows – How to Access two different programs from PATH, both having same name in Windows 10

anacondapythonpython3windowswindows 10

I added addresses of python 2.7, and Anaconda 4.1.1(Python 3.5) to PATH variable in Windows 10, whenever I run "python" from cmd, program which was added earlier is executed.How can I access both of them depending on my choice without altering name of either

Best Answer

Since you specified "without altering the name of either", one possible solution is to make a link (see mklink) to the files somewhere in your path (or more preferably in the same folder as the original file) and that link can have a different name. Then you can use the name of that link to distinguish the two versions, but the file will still have its original name.

Example (run cmd.exe as an administrator - required for mklink):

mklink "python 2.7\python2_7.exe" "python 2.7\python.exe"
mklink "anaconda 4.1.1\python3_5.exe" "anaconda 4.1.1\python.exe"

CD \
python2_7.exe
python3_5.exe