3588AdminBackend/scripts/restart.bat

31 lines
620 B
Batchfile

@echo off
chcp 65001 >nul
cd /d "%~dp0.."
echo ^> 编译 managerd.exe ...
go build -o managerd.exe ./cmd/managerd
if %ERRORLEVEL% neq 0 (
echo 编译失败,请检查代码错误
pause
exit /b 1
)
echo ^> 停止正在运行的 managerd.exe ...
taskkill /f /im managerd.exe 2>nul
echo ^> 启动 managerd.exe ...
start /b "" managerd.exe
echo ^> 等待启动 ...
timeout /t 2 /nobreak >nul
echo ^> 检查进程状态 ...
tasklist /fi "imagename eq managerd.exe" 2>nul | findstr /i managerd >nul
if %ERRORLEVEL% equ 0 (
echo managerd 已启动
) else (
echo 启动失败
pause
exit /b 1
)