Created
September 30, 2015 15:23
-
-
Save bobismijnnaam/ed4772a126e973c890cc to your computer and use it in GitHub Desktop.
Starts a process hidden, inheriting permissions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from win32com.shell import shell | |
import os | |
fileDir = os.path.dirname(os.path.realpath(__file__)) + "\\start.bat" | |
OPEN_NORMAL = 5 | |
OPEN_HIDDEN = 0 | |
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. | |
nShow=OPEN_HIDDEN | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment