diff --git a/MakeInstall.bat b/MakeInstall.bat index 04655d9..1a5d918 100644 --- a/MakeInstall.bat +++ b/MakeInstall.bat @@ -1,9 +1,10 @@ @echo off -setlocal enableDelayedExpansion +REM Get our local path before delayed expansion - allows ! in path +set "thisDir=%~dp0" +setlocal enableDelayedExpansion REM Setup initial vars set "script_name=" -set "thisDir=%~dp0" set /a tried=0 set "toask=yes" set "pause_on_error=yes" diff --git a/Scripts/utils.py b/Scripts/utils.py index 9ee4b30..08a453f 100755 --- a/Scripts/utils.py +++ b/Scripts/utils.py @@ -33,7 +33,7 @@ class Utils: if self.check_admin(): return 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: try: p = subprocess.Popen(["which", "sudo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) diff --git a/gibMacOS.bat b/gibMacOS.bat index 04655d9..1a5d918 100644 --- a/gibMacOS.bat +++ b/gibMacOS.bat @@ -1,9 +1,10 @@ @echo off -setlocal enableDelayedExpansion +REM Get our local path before delayed expansion - allows ! in path +set "thisDir=%~dp0" +setlocal enableDelayedExpansion REM Setup initial vars set "script_name=" -set "thisDir=%~dp0" set /a tried=0 set "toask=yes" set "pause_on_error=yes"