我所下载的redis[http://blog.csdn.net/yueaini10000/article/details/72761092]是没有启动文件,每次启动都需要自己手动进入根目录,然后在运行文件
颇为麻烦
于是就萌生了写一个脚本的想法,然后就按照Tomcat的启动脚本为蓝本写了一个redis的启动脚本
@echo off
rem by:czh60601@126.com
setlocal
rem Guess REDIS_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%REDIS_HOME%" == "" goto gotHome
set "REDIS_HOME=%CURRENT_DIR%"
set "REDIS_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome
if exist "%REDIS_HOME%\redis-server.exe" goto okHome
echo The REDIS_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
rem Check redis.windows.conf exists
if exist "%REDIS_HOME%\redis.windows.conf" goto okExec
echo Cannot find "%REDIS_HOME%\redis.windows.conf"
echo This file is needed to run this program
goto end
:okExec
start redis-server.exe redis.windows.conf
:end