From 7d5eeb6f88e3eaca6a511ec86c34b60e119f830b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD=20=D0=9C=D0=B0=D1=81=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2?= Date: Mon, 31 Oct 2022 09:54:36 +0300 Subject: [PATCH] fix start when disk D (another of dick C) --- Scripts/PythonWinConfigure.cmd | 2 +- Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/PythonWinConfigure.cmd b/Scripts/PythonWinConfigure.cmd index 79b90cc6..fab9e5c1 100644 --- a/Scripts/PythonWinConfigure.cmd +++ b/Scripts/PythonWinConfigure.cmd @@ -42,7 +42,7 @@ cd /d %TEMP_LOCATION% set PYTHONPATH=%cd%;%PYTHONPATH% rem восстановление каталога рабочей директории программы -cd %CD_PREV% +cd /d %CD_PREV% rem выполнить вызов, если есть параметры, начиная с %2+ if "%1"=="" goto :echo_check diff --git a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py index f7b702a7..93a26bf0 100755 --- a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -649,10 +649,10 @@ def OrchestratorRerunAsAdmin(): if not OrchestratorIsAdmin(): if "PYTHON_CONFIGURE" in os.environ: # Re-run the program with admin rights - ctypes.windll.shell32.ShellExecuteW(None, "runas", "cmd", " ".join(["/C", "cd", f'"{os.getcwd()}"', "&&",f'"{os.environ["PYTHON_CONFIGURE"]}"',sys.executable]+sys.argv), None, 1) + ctypes.windll.shell32.ShellExecuteW(None, "runas", "cmd", " ".join(["/C", "cd /d", f'"{os.getcwd()}"', "&&",f'"{os.environ["PYTHON_CONFIGURE"]}"',sys.executable]+sys.argv), None, 1) else: # Re-run the program with admin rights - ctypes.windll.shell32.ShellExecuteW(None, "runas", "cmd", " ".join(["/C", "cd", f'"{os.getcwd()}"', "&&", sys.executable,sys.argv]), None, 1) + ctypes.windll.shell32.ShellExecuteW(None, "runas", "cmd", " ".join(["/C", "cd /d", f'"{os.getcwd()}"', "&&", sys.executable,sys.argv]), None, 1) else: print(f"Уже запущено с правами администратора!")