From 26ead12dce7597daa6023d3b308980a935ed068c Mon Sep 17 00:00:00 2001 From: KawaiiYusora Date: Sun, 16 Mar 2025 06:11:26 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20fix(MaiLauncher.bat):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DMongoDB=E6=9C=8D=E5=8A=A1=E5=90=AF=E5=8A=A8=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MaiLauncher.bat | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MaiLauncher.bat b/MaiLauncher.bat index 80deb04d0..c3dce052a 100644 --- a/MaiLauncher.bat +++ b/MaiLauncher.bat @@ -169,10 +169,14 @@ if exist "%_root%\tools\git\bin" ( :search_mongodb cls sc query | findstr /i "MongoDB" >nul -if %errorlevel% neq 0 ( +if !errorlevel! neq 0 ( echo MongoDB服务未运行,正在尝试启动... - net start MongoDB >nul 2>&1 - if %errorlevel% neq 0 ( + powershell -Command "Start-Process -Verb RunAs cmd -ArgumentList '/c net start MongoDB'" + echo 正在等待MongoDB服务启动... + echo 按下任意键跳过等待... + timeout /t 30 >nul + sc query | findstr /i "MongoDB" >nul + if !errorlevel! neq 0 ( echo MongoDB服务启动失败,可能是没有安装,要安装吗? set /p confirm="继续?(Y/N): " if /i "!confirm!"=="Y" (