Why does python subprocess.Popen start a subprocess through cmd.exe?

I call the subprocess as follows:

command = 'c:\somepath\myexe.exe' startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW p = subprocess.Popen(command, shell=False, startupinfo=startupinfo) 

It appears that instead of running myexe.exe directly, it goes through cmd.exe. Can I avoid cmd.exe here?

+8
python windows subprocess
source share
1 answer

Iff you are using Python 2.7 - use subprocess._subprocess.STARTF_USESHOWWINDOW instead of the .STARTF_USESHOWWINDOW subprocess. I think that would solve it.

+3
source share

All Articles