WindowsStarter/base/Resources/redis/install_redis.bat

19 lines
429 B
Batchfile
Raw Normal View History

2025-08-17 12:38:09 +08:00
@echo off
2025-08-17 02:18:33 +08:00
chcp 65001 >nul
title Install Redis Server
2025-08-14 17:59:23 +08:00
:: 检查是否以管理员身份运行
net session >nul 2>&1
if %errorLevel% neq 0 (
2025-08-17 12:38:09 +08:00
echo Please run this script as Administrator!
2025-08-14 17:59:23 +08:00
pause
exit /b 1
)
cd /d %~dp0
sc create redis binPath= "\"%CD%\redis-server.exe\" --service-run \"%CD%\redis.conf\"" DisplayName= "Redis" start= auto depend= TCPIP
sc description redis "Redis Cache Service"
net start redis
pause