命令行启动参考:

安装redis服务并加入window服务:

redis-server --service-install redis.windows.conf --loglevel verbose

启动:redis-server --service-start

停止:redis-server --service-stop

脚本启动参考:

install.bat

@echo off
echo The path to the currently running batch file:%~dp0
redis-server --service-install redis.windows.conf --loglevel verbose
if %errorlevel% == 0 (
echo execute success
) else (
echo echo execute failed
)
rem pause

 

start.bat

@echo off
echo The path to the currently running batch file:%~dp0
::title设置标题
title Start Redis
redis-server --service-start
if %errorlevel% == 0 (
echo execute success
) else (
echo execute failed
)
pause

 

stop.bat

@echo off
echo The path to the currently running batch file:%~dp0
::title设置标题
title stop Redis
redis-server --service-stop
if %errorlevel% == 0 (
echo execute success
) else (
echo execute failed
)
pause