I have a .bat file with parameters; I run it using os.startfile(test.bat). Is there a way to hide its console? I tried using subprocess, it works well but when I close the parent program the subprocess that was compiled using py2exe console mode closes too.
info = subprocess.STARTUPINFO()
info.dwFlags=1
info.wShowWindow=0
subprocess.Popen(test.bat,startupinfo=info)
Thanks
Use
shell=Trueandcreationflags=subprocess.SW_HIDEwithsubprocess.Popen. This worked for meIn some releases of Python,
SW_HIDEis not available insubprocessmodule. In that case, you may have to use_subprocess.SW_HIDE