.bat 判断并启动一个系统服务
@echo off REM 定义服务名称变量 set SERVICE_NAME=RemoteClient REM 检查服务状态 sc query %SERVICE_NAME% | findstr RUNNING > nul if %errorlevel% equ 0 ( echo %SERVICE_NAME% is already running. ) else ( REM 启动服务 net start %SERVICE_NAME% if %errorlevel% equ 0 ( echo %SERVICE_NAME% has been started successfully. ) else ( echo %SERVICE_NAME% failed to start. ) )
桂棹兮兰桨,击空明兮溯流光。