030_Windows下开机自启
一键启动脚本
:::info
直接执行脚本,可一键启动
:::
@echo off
title one touch start
@echo redis starting...
start /d "C:\redis" redis-server.exe
@echo nginx starting...
start /d "C:\nginx" nginx.exe
@echo minio starting...
start /d "C:\minio" minio.exe server C:\minio\store
@echo power.jar stopping...
set port=8080
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (
echo kill the process %%m who use the port
taskkill /pid %%m -t -f
goto stopPower
)
:stopPower
@echo job.jar stopping...
set port=9100
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (
echo kill the process %%m who use the port
taskkill /pid %%m -t -f
goto stopJob
)
:stopJob
@echo job.jar starting...
start java -jar C:\powerShovel\api\job.jar
@echo power.jar starting...
start java -jar C:\powerShovel\api\power.jar
echo "the window will close in 10s"
timeout /T 10
@echo on