windows – Run py script with python.exe from specific conda env

I use Anaconda3 and a specific environment rather than the base environment for my projects. The thing is that I cannot set my .py files to open with python.exe interpreter from that environment in anaconda3\envs\env1. When I right-click a py file, go to properties and set it to open with python.exe for that env and run the script, the path showing on the terminal title bar says “anaconda3/python.exe”, meaning that it is using the base python.exe, not the one from my env.
Is there a way to set this configuration? It’s important for me because it is an automation script I run by double-clicking or selecting it and hitting Enter.

I was thinking if there is a way to create a bat file so the py file would open through it, the bat file would execute the command “interpreterPath/python.exe” “path/to/script.py”.
The bat reads the shebang line in the script to know what interpreter to use.

Read more here: Source link