Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/10se1ucgo/DisableWinTracking.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dwt.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/dwt.py b/dwt.py
index 87ab79d..2f46957 100644
--- a/dwt.py
+++ b/dwt.py
@@ -460,7 +460,12 @@ def exception_hook(error, value, trace):
def check_elevated(silent=False):
if not bool(windll.advpack.IsNTAdmin(0, None)):
- windll.shell32.ShellExecuteW(None, u"runas", unicode(sys.executable), unicode(__file__), None, 1)
+ if silent:
+ windll.shell32.ShellExecuteW(None, u"runas", unicode(sys.executable), u"{0} -silent".format(unicode(__file__)), None, 1)
+ sys.exit(1)
+ else:
+ windll.shell32.ShellExecuteW(None, u"runas", unicode(sys.executable), unicode(__file__) + u" -silent", None, 1)
+ sys.exit(1)
def silent():