MrDj200

AutoPingTest

Jan 19th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.59 KB | None | 0 0
  1. @ECHO off
  2. title AutoPingScript      Copyright by MrDjSoft 2014
  3. ::###########################################
  4. ::                            Variablen
  5. ::###########################################
  6.  
  7.  set NickName=MrDj
  8.  
  9.  set AutoPingIP=109.230.255.203
  10.  set TestIP=www.YouTube.com
  11.  set TestIP2=www.amazon.com
  12.  set TestIP3=www.google.com
  13.  
  14.  set PingAnzahl=1
  15.  set PausenZeit=10
  16.  
  17.  set Datei=C:\Users\%USERNAME%\AppData\Roaming\.MrDjSoft\AutoPing\%AutoPingIP%\ServerDowntime.txt
  18.  
  19.  set Meldung=C:\Users\%USERNAME%\AppData\Roaming\.MrDjSoft\AutoPing\Server_Down.exe
  20.  set Meldung1=KeinInternet.cmd
  21.  
  22. ::################################################################
  23. ::                              DO NOTHING UNDER THIS LINE
  24. ::                  UNLESS YOU KNOW WHAT YOU ARE DOING!!!!
  25. ::################################################################
  26.  :start
  27.  
  28.  if exist C:\Users\%USERNAME%\AppData\Roaming\.MrDjSoft goto MrDjSoftCheck
  29.     md C:\Users\%USERNAME%\AppData\Roaming\.MrDjSoft
  30.     ECHO Hallo hier landen Unterschiedlichste Dateien meiner Scripte! >C:\Users\%USERNAME%\AppData\Roaming\.MrDjSoft\README.txt
  31.  :MrDjSoftCheck
  32.  
  33.  if exist C:\Users\%USERNAME%\AppData\Roaming\.MrDjSoft\AutoPing goto PfadCheck
  34.     md C:\Users\%USERNAME%\AppData\Roaming\.MrDjSoft\AutoPing
  35.     md C:\Users\%USERNAME%\AppData\Roaming\.MrDjSoft\AutoPing\%AutoPingIP%
  36.  :PfadCheck
  37.  
  38.  if exist %Meldung% goto MeldungCheck
  39.     bitsadmin.exe /transfer "MeldungsDL" http://109.230.255.203/Scripts/AutoPing/Meldung/Server_Down.exe %Meldung%
  40.  
  41.  
  42.  :MeldungCheck
  43. ::if exist %Meldung% goto klar
  44. ::ECHO @ECHO off > %Meldung%
  45. ::ECHO title Server ist Offline!!!!       Copyright by MrDjSoft 2014 >> %Meldung%
  46. ::ECHO mode con: cols=75 lines=5 >> %Meldung%
  47. ::ECHO color bc >> %Meldung%
  48. ::ECHO echo Der Server ist nicht mehr erreichbar!! >> %Meldung%
  49. ::ECHO cls >> %Meldung%
  50. ::ECHO @echo   >> %Meldung%
  51. ::ECHO cls >> %Meldung%
  52. ::ECHO timeout /t 1 /nobreak >NUL >> %Meldung%
  53. ::ECHO cls >> %Meldung%
  54. ::ECHO @echo   >> %Meldung%
  55. ::ECHO cls >> %Meldung%
  56. ::ECHO timeout /t 1 /nobreak >NUL >> %Meldung%
  57. ::ECHO cls >> %Meldung%
  58. ::ECHO @echo   >> %Meldung%
  59. ::ECHO cls >> %Meldung%
  60. ::ECHO timeout /t 1 /nobreak >NUL >> %Meldung%
  61. ::ECHO cls >> %Meldung%
  62. ::ECHO @echo   >> %Meldung%
  63. ::ECHO cls >> %Meldung%
  64. ::ECHO timeout /t 1 /nobreak >NUL >> %Meldung%
  65. ::ECHO cls >> %Meldung%
  66. ::ECHO @echo   >> %Meldung%
  67. ::ECHO cls >> %Meldung%
  68. ::ECHO echo Bitte Warten >> %Meldung%
  69. ::ECHO timeout /t 10 /nobreak ">NUL" >> %Meldung%
  70. ::ECHO exit >> %Meldung%
  71.  
  72.  :klar
  73.  set ZeitStempel=%DATE%   %TIME:~0,5%
  74.  
  75.  ping %AutoPingIP% -n %PingAnzahl%
  76.  if errorlevel 1 goto Test1
  77.  if errorlevel 0 goto Erfolgreich
  78.  
  79.  :Test1
  80.  cls
  81.  ECHO InternetVerbindung wird getestet!
  82.  ECHO [%USERNAME%] Verbindung zu %TestIP% wird getestet!  [%ZeitStempel%] >> ServerDowntime.txt
  83.  ping %TestIP% -n %PingAnzahl%
  84.  
  85.  if errorlevel 1 goto Test2
  86.  if errorlevel 0 goto ServerAus
  87.  
  88.  :Test2
  89.  cls
  90.  ECHO InternetVerbindung wird getestet!
  91.  ECHO [%USERNAME%] Verbindung zu %TestIP2% wird getestet!  [%ZeitStempel%] >> ServerDowntime.txt
  92.  ping %TestIP2% -n %PingAnzahl%
  93.  
  94.  if errorlevel 1 goto Test3
  95.  if errorlevel 0 goto ServerAus
  96.  
  97.  :Test3
  98.  cls
  99.  ECHO InternetVerbindung wird getestet!
  100.  ECHO [%USERNAME%] Verbindung zu %TestIP3% wird getestet!  [%ZeitStempel%] >> ServerDowntime.txt
  101.  ping %TestIP3% -n %PingAnzahl%
  102.  
  103.  if errorlevel 1 goto KeinInternet
  104.  if errorlevel 0 goto ServerAus
  105.  
  106.  :Erfolgreich
  107.  timeout /t %PausenZeit% /nobreak >NUL
  108.  cls
  109.  goto start
  110.  
  111.  :ServerAus
  112.  start %Meldung%
  113.  ECHO
  114.  goto start
  115.  
  116.  :KeinInternet
  117.  goto Test1
Advertisement
Add Comment
Please, Sign In to add comment