openthebox/OpenTheBox.cmd

17 lines
689 B
Batchfile
Raw Permalink Normal View History

@echo off
REM Launch Open The Box in Windows Terminal with PowerShell and UTF-8 support.
REM Falls back to PowerShell directly if Windows Terminal is not available.
where wt >nul 2>nul
if %ERRORLEVEL% equ 0 (
wt new-tab -p "PowerShell" -- pwsh -NoProfile -Command "& { [Console]::OutputEncoding = [Text.Encoding]::UTF8; dotnet run --project '%~dp0src\OpenTheBox' -- %* }"
) else (
where pwsh >nul 2>nul
if %ERRORLEVEL% equ 0 (
pwsh -NoProfile -Command "& { [Console]::OutputEncoding = [Text.Encoding]::UTF8; dotnet run --project '%~dp0src\OpenTheBox' -- %* }"
) else (
chcp 65001 >nul 2>nul
dotnet run --project "%~dp0src\OpenTheBox" -- %*
)
)