Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Batch file not running but works when I manually type in to command line

Hey so I have a pretty simple request for a bat file

%windir%\System32\cmd.exe "/K" C:\Users\kevin\anaconda3\Scripts\activate.bat C:\Users\kevin\anaconda3
conda activate flight
python C:\Users\kevin\Documents\PythonScripts\FDIBASE.py

That is all I want to do. When I go into my command line manually then individually type those three lines it works perfectly fine (it does take a few seconds for each line to finish before I execute the next however)

I am new to bat files so I think its just something wrong with the format but I don’t get why it does not work.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

See this ref, we need using call to activate the conda environment

call C:\Users\kevin\anaconda3\Scripts\activate.bat C:\Users\kevin\anaconda3\envs\flight

python C:\Users\kevin\Documents\PythonScripts\FDIBASE.py

call conda deactivate
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading