Tuesday, November 8, 2011

Open EXE with Python

I guess we all reach a point in our scripting space when we end up with opening an exe file from the script. Well , here the code for it . just replace the contents with the values you desire

import subprocess
import os
from win32api import ShellExecute
ShellExecute(0, "open","C:\\XXXX\\XXXX.exe","" , "C:\\XXX", 1)

There might be other ways of doing it , but i believe this one is simple enough for you to try.


No comments:

Post a Comment