Windows 10

How To Run A Python Script From A Batch File

In this tutorial, we are going to see how to run a Python script from a batch file. The batch file contains a series of DOS (Disk Operating System) instructions. It allows triggering the execution of commands found in this file.
 

How To Run A Python Script From A Batch File

The following example runs the Python script “myscript.py” from the batch file. If ‘python’ is not recognized as an internal or external command you may need to install python:

@echo off
python c:\myscript.py %*
pause

Leave a Reply

Your email address will not be published. Required fields are marked *