批处理文件

frp启动

rem 域名:t.maoriaty.top,端口:80
cd /d "E:\JabinDOC\软件备份\frp_0.13.0_windows_amd64"
start ./frpc -c ./frpc.ini

nginx启动

rem 练习案例指向E:\JabinDOC\Demo,端口7777
set nginx_home=C:\nginx-1.12.0
cd /d %nginx_home%
tasklist | findstr /i "nginx.exe"
echo %errorlevel%
if %ERRORLEVEL% == 0 (
  goto stop_nginx
  goto start_nginx
  goto end
)else ( rem else后要有空格
  goto start_nginx
  goto end
)
:stop_nginx
  taskkill /F /IM nginx.exe /T
:start_nginx
  rem 以字符串格式启动
  start "" "nginx.exe"
  pause
:end

 wampserver启动

rem 以管理员运行
@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"

rem 启动wampserver
set wamp_path=C:\wamp64
cd /d %wamp_path%
tasklist | findstr /i wampmanager.exe
echo %errorlevel%
if %ERRORLEVEL% == 0 (
  goto stop_wamp
  goto start_wamp
)else (
  goto start_wamp
)
:stop_wamp
  taskkill /f /im wampmanager.exe /t
:start_wamp
  start "" "wampmanager.exe"

tomcat启动

rem Tomcat项目启动根目录转到E:\JabinDOC\Tomcat_www
set CATALINA_HOME=D:\software\deploy\apache-tomcat-8.0.36-old
call D:\software\deploy\apache-tomcat-8.0.36-old\bin\startup.bat

 

posted @ 2018-01-08 14:47  maoriaty  阅读(118)  评论(0编辑  收藏  举报