写了个简单关闭龙ol服务端的批处理全部整合一起了(包括mysql),老鸟勿喷~

本帖最后由 pascal331 于 2011-1-25 18:54 编辑

如题

bat多了也麻烦,干脆就写一起算了,开关服务器就一个bat就够了


24日更新,汲取了12楼的经验

  1. :meun
  2. cls
  3. @echo off
  4. color 20
  5. title 龙ol服务端开关批处理,请按提示操作!中途请勿关闭窗口待运行完指令后将自行关闭
  6. echo.
  7. echo                               输入字母执行相应操作
  8. echo                  **********************************************
  9. echo                  *  s.启动MySQL和服务端        r.重启服务端   *           
  10. echo                  *  d.关闭服务端和MySQL        e.取消并退出   *
  11. echo                  **********************************************
  12. echo.
  13. :cs
  14. choice /c sdre /n /m”: 选择执行类型 :”
  15. if errorlevel 1 (goto om)
  16. if errorlevel 4 (goto ex)
  17. if errorlevel 3 (goto rt)
  18. if errorlevel 2 (goto ds)
  19. :om
  20. cls
  21. copy D:\game\启动数据库\local\mysql\my.ini %SystemRoot% /y >nul
  22. IF ERRORLEVEL 1 goto hint
  23. set programit=D:\game\启动数据库\local\home\admin\program\
  24. set closeit=%programit%close.bat %Disk%
  25. start D:\game\启动数据库\local\mysql\bin\mysqld-nt.exe –defaults-file=D:/game/启动数据库/local/mysql/bin/my-small.cnf
  26. net start mysql
  27. SET wait=ping -n 2 127.0.0.1 ^>^nul
  28. for /l %%n in (5,-1,0) do (
  29.    rem cls
  30.    echo **************************************
  31.    echo.
  32.    echo          %%n秒后自动开启服务器…
  33.    echo.
  34.    echo **************************************
  35.    %wait%
  36.    cls
  37.    )
  38.    start D:\game\server\LoginServer3.exe
  39. ping -n 4 127.0.0.1>nul
  40. start D:\game\server\LoongBillServer.exe
  41. ping -n 4 127.0.0.1>nul
  42. start D:\game\server\LoongDB.exe
  43. ping -n 4 127.0.0.1>nul
  44. start D:\game\server\LoongWorld.exe
  45. (
  46. :ds
  47. cls
  48. SET wait=ping -n 2 127.0.0.1 ^>^nul
  49. for /l %%n in (5,-1,0) do (
  50.    rem cls
  51.    echo **************************************
  52.    echo.
  53.    echo          %%n秒后关闭服务器…
  54.    echo.
  55.    echo **************************************
  56.    %wait%
  57.    cls
  58.    )
  59.    taskkill /f /t /im LoginServer3.exe
  60. taskkill /f /t /im LoongBillServer.exe
  61. taskkill /f /t /im LoongDB.exe
  62. taskkill /f /t /im LoongWorld.exe
  63. ping -n 2 127.0.0.1>nul
  64. D:\game\启动数据库\local\home\admin\program\pskill.exe mysqld-nt.exe c
  65. D:\game\启动数据库\local\home\admin\program\pskill.exe Apache.exe c
  66. IF “%Disk%”==”” set Disk=w
  67. subst “%Disk%”
  68. (
  69. goto end
  70. :rt
  71. cls
  72. taskkill /f /t /im LoginServer3.exe
  73. taskkill /f /t /im LoongBillServer.exe
  74. taskkill /f /t /im LoongDB.exe
  75. taskkill /f /t /im LoongWorld.exe
  76. SET wait=ping -n 2 127.0.0.1 ^>^nul
  77. for /l %%n in (5,-1,0) do (
  78.    rem cls
  79.    echo **************************************
  80.    echo.
  81.    echo          %%n秒后重启服务器…
  82.    echo.
  83.    echo **************************************
  84.    %wait%
  85.    cls
  86.    )
  87.    start D:\game\server\LoginServer3.exe
  88. ping -n 4 127.0.0.1>nul
  89. start D:\game\server\LoongBillServer.exe
  90. ping -n 4 127.0.0.1>nul
  91. start D:\game\server\LoongDB.exe
  92. ping -n 4 127.0.0.1>nul
  93. start D:\game\server\LoongWorld.exe
  94. (
  95. :ex
  96. exit

复制代码
———————————————————————–


忘记说了,这个是针对一键端的,如果是用论坛上另一个手工端就将LoongWorld.exe改成LoongWorld_1.exe
汲取了12楼的经验
图片[1]-写了个简单关闭龙ol服务端的批处理全部整合一起了(包括mysql),老鸟勿喷~-七玩网 龙ol服务端应用.rar (939 Bytes, 下载次数: 456) 2011-1-25 18:54 上传 点击文件名下载附件

请登录后发表评论

    没有回复内容