Create a gist now

Instantly share code, notes, and snippets.

Starts a process hidden, inheriting permissions.
from import shell
import os
fileDir = os.path.dirname(os.path.realpath(__file__)) + "\\start.bat"
a = shell.ShellExecuteEx(
# "runas" is also nice, to request admin rights before starting. See MSDN docs on ShellExecuteEx for details.
lpVerb = "open",
# Right now it just launches a batch file in the same folder as the .py file, but if you want to customize, this is probably the droid you're looking for.
lpFile = fileDir,
# Change the following to change the behaviour of the opened window. E.g. OPEN_HIDEN will run the process invisibly, while OPEN_NORMAL will just show the window. See the MSDN docs on ShellExecuteEx for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment