Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. @echo off
  2. rem Everywhere you see "rem" as a command is simply developer notes to help keep track of what and where everything is. Deleting all rem commands will not affect the program.
  3. if not exist "C:Program FilesLedPing Testorversion1.7.info" goto new
  4. if exist "C:Program FilesLedPing Testorversion1.7.info" goto old
  5. rem Checks for first-time launch on local machine.
  6.  
  7. :new
  8. if not exist "C:Program FilesLed"
  9. (
  10. cd "C:Program Files"
  11. md Led
  12. )
  13. if not exist "C:Program FilesLedPing Testor"
  14. (
  15. cd "C:Program FilesLed"
  16. md "Ping Testor"
  17. )
  18. if not exist "C:Program FilesLedPing Testorversion"
  19. (
  20. cd "C:Program FilesLedPing Testor"
  21. md "version"
  22. )
  23. if not exist "C:Program FilesLedPing Testorversion1.7.info"
  24. (
  25. cd "C:Program FilesLedPing Testorversion"
  26. echo "1.7235 Release. Beta Officially Closed. More Information at LedDevelopment.CU.CC/main/products/led-ping-testor" >1.7.info
  27. )
  28. goto old
  29. rem Creates all necessary directories if they don't exist and adds version information to the directory.
  30.  
  31. :old
  32. title Led Development AB 2015 - 2016
  33. color 0a
  34. mode con: cols=65 lines=18
  35. cls
  36. rem Window setup (Initial).
  37.  
  38. :a
  39. echo Led Ping Testor v1.7235(R)
  40. rem The (R) after the version number indicates state/build type. (R) in this case means release, as in finished product. (B) is for Beta (Used for testing and developing by both users and proffessional developers), and there's (A) which is the essentials of the code for the program to function at all(Led Development Team Only).Occasionally, an (E) (evaluation copy) is developed.
  41. echo =============== ==========
  42. echo Welcome to the Led Ping Testor. Please choose 1 to test your pingto our official website server or 2 to test your connection to a custom IP Address/Website. If you don't understand any of this, choose option 1.
  43. echo.
  44. echo NOTE: A log file keeps track of all the ping results,as well as time and date,but no personal information is kept,including your IP Address or computer name. To view the log file,type "log" without the quotation marks and hit enter. Similarly,if you wish to clear the log of all data,type "logclr" without the quotation marks and hit enter.
  45. rem Intro text.
  46.  
  47. set /p op=
  48. if %op%== 1 goto ping1
  49. if %op%== 2 goto ping2a
  50. if %op%== log goto log
  51. if %op%== logclr goto logclr
  52. rem This checks for all eligible user input for this stage.
  53. goto old
  54. rem This takes user back to Main Screen in case of non-eligible input.
  55.  
  56. :log
  57. cls
  58. if exist "C:Program FilesLedPing Testorlog.txt"
  59. (
  60. cd "C:Program FilesLedPing Testor"
  61. start log.txt
  62. )
  63. rem Opens log if exists.
  64.  
  65. if not exist "C:Program FilesLedPing Testorlog.txt"
  66. (
  67. cls
  68. echo The log file is empty, thus cannot be openned.
  69. pause
  70. goto a
  71. )
  72. rem Gives error message if log doesn't exist.
  73.  
  74.  
  75. :logclr
  76. cls
  77. cd "C:Program FilesLedPing Testor"
  78. del log.txt
  79. goto old
  80.  
  81. :ping1
  82. echo Please choose how many times you want to ping the host.
  83. set /p %numb%
  84. if %numb% < 1 goto ping1a
  85. if %numb% > 99999 goto ping1a
  86. rem Checks if user input was between 1 and 99999 to confirm user input as an interger (numbers only).
  87. cls
  88. rem If user input isn't an integer between 1 and 99999, error message explaining appears in a new window.
  89. msg %username% Warning: Not a numerical value between 1 and 99999. Please check your spelling and remove all letters, special characters and spaces.
  90. goto ping1
  91.  
  92. :ping1a
  93. cls
  94. title Pinging 185.28.21.39...
  95. cls
  96. cd "C:Program FilesLedPing Testor"
  97. echo ========================================================= >>log.txt
  98. echo Host:185.28.21.39 Ping Count:%numb% >>log.txt
  99. echo Include this in any bug reports for the Ping Testor. >>log.txt
  100. echo %date% >> log.txt
  101. rem All this chunck of code above is the injection of data to the log file.
  102.  
  103. :ping11
  104. echo Led Ping Testor
  105. echo ===============
  106. echo The ping is called time, and is displayed upon every loop.
  107. echo.
  108. ping 185.28.21.39 -n %numb% >>log.txt
  109. ping 185.28.21.39 -n %numb%
  110. ping localhost -n 2 >nul
  111. cls
  112. goto ping11
  113. rem And this chunck performs the same thing as above but infront of the user.
  114.  
  115. echo Welcome to the Led Ping Testor. Please choose 1 to test your pingto our official website server or 2 to test your connection to a custom IP Address/Website. If you don't understand any of this, choose option 1.
  116. echo.
  117. echo NOTE: A log file keeps track of all the ping results,as well as time and date,but no personal information is kept,including your IP Address or computer name. To view the log file,type "log" without the quotation marks and hit enter. Similarly,if you wish to clear the log of all data,type "logclr" without the quotation marks and hit enter.
  118. rem Intro text.
  119.  
  120. set /p op=
  121. if %op%== 1 goto ping1
  122. if %op%== 2 goto ping2a
  123. if %op%== log goto log
  124. if %op%== logclr goto logclr
  125. rem This checks for all eligible user input for this stage.
  126. goto old
  127. rem This takes user back to Main Screen in case of non-eligible input.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement