-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathLaunch.cmd
More file actions
34 lines (28 loc) · 906 Bytes
/
Launch.cmd
File metadata and controls
34 lines (28 loc) · 906 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
@echo off
setlocal
net session >nul 2>&1
if not %errorlevel%==0 (
echo [INFO] Requesting Administrator privileges...
if "%~1"=="" (
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
) else (
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -ArgumentList @('%*') -Verb RunAs"
)
exit /b
)
set "SCRIPT=%~dp0scripts\launch.ps1"
if not exist "%SCRIPT%" (
echo [ERROR] Missing PowerShell script: "%SCRIPT%"
echo Ensure launch.ps1 exists under the 'scripts' folder next to this file.
pause
exit /b 1
)
set "PORT=%~1"
if "%PORT%"=="" set "PORT=80"
echo [INFO] Invoking PowerShell launcher on port %PORT% ...
powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT%" -Port %PORT%
set "EC=%ERRORLEVEL%"
echo.
echo [INFO] PowerShell script exited with code %EC%
pause
endlocal & exit /b %EC%