The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Batch
By Guest on 19th March 2017 03:30:58 AM | Syntax: WINBATCH | Views: 102



New paste | Download | Show/Hide line no. | Copy text to clipboard
  1. ::      -bw_server_monitor.bat 
  2.                 @echo off
  3.                 title bw_server_monitor.bat
  4.                 :start
  5.                 C:\Windows\System32\tasklist /FI "IMAGENAME eq BlackwakeServer.exe" 2>NUL | C:\Windows\System32\find /I /N "BlackwakeServer.exe">NUL
  6.                 if "%ERRORLEVEL%"=="0" goto loop
  7.                 echo Server is not running, will be started now
  8.                 start "" /min /wait "C:\_blackwake\bw_server_start.bat"
  9.                 timeout 30
  10.                 echo Server started succesfully
  11.                 goto started
  12.                 :loop
  13.                 cls
  14.                 echo Server is already running, running monitoring loop
  15.                 C:\Windows\System32\timeout /t 80
  16.                 C:\Windows\System32\tasklist /FI "IMAGENAME eq BlackwakeServer.exe" 2>NUL | C:\Windows\System32\find /I /N "BlackwakeServer.exe">NUL
  17.                 if "%ERRORLEVEL%"=="0" goto loop
  18.                 goto start



  • Recent Pastes