useful snippets
General Info
Useful Snippets

14.0.1 Create a bat file to run a python file

Description:

It can be convenient to have an icon that you can click to run a python file. Additionaly, if you want to schedule a python file to run using Windows Scheduler, for instance, you'll need to create a .bat file to run your python file. This is because Windows Scheduler cannot run python files directly, but it can run .bat files. So, if you want to trigger a python file with Windows Scheduler you can create an intermediary "wrapper" file that connects you python file to Windows Scheduler and runs the python file on Windows Scheduler's behalf.

Example:

"C:\Program Files\Python38\python.exe"  "F:\the\location\of\your\python\file.py"