Python Forum

Full Version: Run hidden exe
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello dear users, iam trying to call exe. file from python and run it hidden. I want to run it without user operation. I have this script and it is working fine but when windows needs to ask this, it is not working -
116880004-1421707291368565-1292061420754641316-n


Is it possible to add something to this code to skip this or always allow to run targeted exe. ?
When i run this program and accept is needed, this program crash. When i run this program and acept is not needed it works fine.

import subprocess

def startProgram():
    SW_HIDE = 0
    info = subprocess.STARTUPINFO()
    info.dwFlags = subprocess.STARTF_USESHOWWINDOW
    info.wShowWindow = SW_HIDE
    subprocess.Popen(r"C:\Program Files\SketchUp\SketchUp 2017\SketchUp.exe", startupinfo=info)
startProgram()