This commit is contained in:
Andrew Lee 2021-04-23 21:16:38 -04:00
commit 5629ebe7bb
No known key found for this signature in database
GPG key ID: 4DCE67C47836D125
3 changed files with 7 additions and 5 deletions

View file

@ -1,9 +1,10 @@
@echo off @echo off
setlocal enableDelayedExpansion REM Get our local path before delayed expansion - allows ! in path
set "thisDir=%~dp0"
setlocal enableDelayedExpansion
REM Setup initial vars REM Setup initial vars
set "script_name=" set "script_name="
set "thisDir=%~dp0"
set /a tried=0 set /a tried=0
set "toask=yes" set "toask=yes"
set "pause_on_error=yes" set "pause_on_error=yes"

View file

@ -33,7 +33,7 @@ class Utils:
if self.check_admin(): if self.check_admin():
return return
if os.name == "nt": if os.name == "nt":
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, file, None, 1) ctypes.windll.shell32.ShellExecuteW(None, "runas", '"{}"'.format(sys.executable), '"{}"'.format(file), None, 1)
else: else:
try: try:
p = subprocess.Popen(["which", "sudo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) p = subprocess.Popen(["which", "sudo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

View file

@ -1,9 +1,10 @@
@echo off @echo off
setlocal enableDelayedExpansion REM Get our local path before delayed expansion - allows ! in path
set "thisDir=%~dp0"
setlocal enableDelayedExpansion
REM Setup initial vars REM Setup initial vars
set "script_name=" set "script_name="
set "thisDir=%~dp0"
set /a tried=0 set /a tried=0
set "toask=yes" set "toask=yes"
set "pause_on_error=yes" set "pause_on_error=yes"