Python Forum
run setup.exe from python script with special parameters - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: run setup.exe from python script with special parameters (/thread-15816.html)



run setup.exe from python script with special parameters - asheru93 - Feb-01-2019

So I have an setup.exe that I want to execute from a python script. If i run it outside a python script so directly in the command line it works as expected now i want to run in from a python script. This is the command; i need all the parameteres and the double quotes in order to to evreything as expected.

  C:\pathToExe\setup.exe /S /v"/qb! /norestart"
How do i store this command in a variable and then execute it in a python script. I know I can use 'subprocess' to execute a .exe but for me the parameters given are important.

Something like this is not working:
myPathExe = 'cmd /q /C' + 'C:\pathToExe\setup.exe' + /S /v"/qb! /norestart"
run(myPathExe)