[Python] Execute exe-file with bat-file from Python

Discussão em 'Python' iniciado por Stack, Março 28, 2025.

  1. Stack

    Stack Membro Participativo

    I have an exe-file that I need to run several times with different parameters. I can manually (or with Python) create a bat-file with all the parameters and then run the exe-file

    C:\RAY\Reflec.exe < test.bat

    in a cmd window but I run into problems when I try to make Python run it. The exe-file is executed but it does not take in the parameters in the bat-file. I have tried various ways, e.g. using os.startfile, subprocess.call, and so on but I can not get it to work. All I achieve is to run the exe-file but then it is waiting for the parameters. I don't get any error messages.

    Can someone please help me with the syntax? Thanks.

    Continue reading...

Compartilhe esta Página