I'm trying to replicate a UNIX bin folder on my Windows 10 PC. I have created a folder located at "C:\bin" and added it to my PATH variable. However, I'm not really sure as how to implement it any further than this. I've tried adding shortcuts (lnk-files) to the folder but I can't get that to work.
My goal is to be able to write "python37" in the command prompt to run "C:\Users\Samuel\AppData\Local\Programs\Python\Python37\python.exe" and write "python38" to run "C:\Users\Samuel\AppData\Local\Programs\Python\Python38-32\python.exe".
Simply adding both directories to the PATH variable wouldn't work since both of the executables have the same name, or am I wrong?
You should be able to create shortcuts and run them like in your original attempt. What's not working? But yes, you would have to name the shortcuts something unique in your bin folder. You would need to include the .lnk
extension when executing.
So, in your C:\bin
folder and with it in your path create a shortcut to the Python32 exe, name it python37 and execute it by:
C:\somedir> python37.lnk
Alternatively, you could create a .bat file and run it. For Python37 you could create C:\bin\python37.bat
with this as the contents:
"C:\Users\Samuel\AppData\Local\Programs\Python\Python37\python.exe" %*
That should let you exclude the extension if you just want a clean python37
command.
C:\somedir> python37
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments