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"Уже запущено с правами администратора!")