Skip to content

Commit 6e778bd

Browse files
committed
fix: start.bat/stop.bat fail on Chinese Windows cmd.exe
The .bat files were saved as UTF-8 with LF line endings and contained Chinese characters in comments. cmd.exe on zh-CN Windows runs under code page 936 (GBK), so it decoded the UTF-8 em dash (e2 80 94) and subsequent Chinese bytes as invalid GBK, producing '文件名、目录名或 卷标语法不正确' before start.bat ever reached the PowerShell call. Rewrite both launchers as ASCII-only with CRLF line endings so they parse identically on any codepage.
1 parent 570e135 commit 6e778bd

2 files changed

Lines changed: 35 additions & 35 deletions

File tree

start.bat

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
@echo off
2-
:: Screen Pilot — 双击启动
3-
:: Windows 会自动处理 PowerShell 执行策略,直接双击即可。
4-
5-
cd /d "%~dp0"
6-
7-
where pwsh >nul 2>&1
8-
if %errorlevel% equ 0 (
9-
pwsh -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\dev\start-local-agent.ps1"
10-
) else (
11-
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\dev\start-local-agent.ps1"
12-
)
13-
14-
if %errorlevel% neq 0 (
15-
echo.
16-
echo Something went wrong. Press any key to close...
17-
pause >nul
18-
)
1+
@echo off
2+
:: Screen Pilot - double click to start.
3+
:: Windows handles the PowerShell execution policy automatically.
4+
5+
cd /d "%~dp0"
6+
7+
where pwsh >/dev/null 2>&1
8+
if %errorlevel% equ 0 (
9+
pwsh -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\dev\start-local-agent.ps1"
10+
) else (
11+
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\dev\start-local-agent.ps1"
12+
)
13+
14+
if %errorlevel% neq 0 (
15+
echo.
16+
echo Something went wrong. Press any key to close...
17+
pause >/dev/null
18+
)

stop.bat

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
@echo off
2-
:: Screen Pilot — 双击停止
3-
4-
cd /d "%~dp0"
5-
6-
where pwsh >nul 2>&1
7-
if %errorlevel% equ 0 (
8-
pwsh -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\dev\stop-local-agent.ps1"
9-
) else (
10-
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\dev\stop-local-agent.ps1"
11-
)
12-
13-
if %errorlevel% neq 0 (
14-
echo.
15-
echo Press any key to close...
16-
pause >nul
17-
)
1+
@echo off
2+
:: Screen Pilot - double click to stop.
3+
4+
cd /d "%~dp0"
5+
6+
where pwsh >/dev/null 2>&1
7+
if %errorlevel% equ 0 (
8+
pwsh -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\dev\stop-local-agent.ps1"
9+
) else (
10+
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\dev\stop-local-agent.ps1"
11+
)
12+
13+
if %errorlevel% neq 0 (
14+
echo.
15+
echo Press any key to close...
16+
pause >/dev/null
17+
)

0 commit comments

Comments
 (0)