-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRun_Python_Manager.cmd
More file actions
42 lines (33 loc) · 963 Bytes
/
Copy pathRun_Python_Manager.cmd
File metadata and controls
42 lines (33 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
setlocal
rem Keep this launcher ASCII-only. It is started by cmd.exe before PowerShell
rem can control UTF-8 output.
chcp 65001 >nul 2>&1
set "SCRIPT_DIR=%~dp0"
set "SCRIPT_FILE=%SCRIPT_DIR%Python_Manager.ps1"
net session >nul 2>&1
if not "%ERRORLEVEL%"=="0" (
echo Requesting administrator rights...
set "PM_FILE=%~f0"
set "PM_DIR=%SCRIPT_DIR%"
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath $env:PM_FILE -WorkingDirectory $env:PM_DIR -Verb RunAs"
exit /b
)
title Python Manager
mode con: cols=105 lines=36 >nul 2>&1
if not exist "%SCRIPT_FILE%" (
echo ERROR: File not found:
echo "%SCRIPT_FILE%"
echo.
pause
exit /b 1
)
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_FILE%"
set "EXIT_CODE=%ERRORLEVEL%"
if not "%EXIT_CODE%"=="0" (
echo.
echo ERROR: PowerShell finished with exit code %EXIT_CODE%.
echo.
pause
)
exit /b %EXIT_CODE%