#How to make a python script run a .bat file
14 messages · Page 1 of 1 (latest)
Thanks for your question :clap:, if someone gives you an answer it would be great if you thanked them with a :white_check_mark: in response. This response will earn you both points for special roles on this server.
what is the contents of the .bat file cause it could be an error with the batch file ?
So I tried it with this:
import os
os.system("test.bat")
And my Output what this:
>echo "This is a test!"
"This is a test!"
This way it worked for me.
tried os.system
it works fine when i run from vscode but if i run the .py itself i get this
operable program or batch file```
its fine if i cant get the .py to work but id prefer for it to work from there
Did you enter the Absolut path? this should help to execute from anywhere
In my code I just executed it in the current directory so I did not need to enter the Absolut path.
its in the same directory