Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- 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.
- if not exist "C:Program FilesLedPing Testorversion1.7.info" goto new
- if exist "C:Program FilesLedPing Testorversion1.7.info" goto old
- rem Checks for first-time launch on local machine.
- :new
- if not exist "C:Program FilesLed"
- (
- cd "C:Program Files"
- md Led
- )
- if not exist "C:Program FilesLedPing Testor"
- (
- cd "C:Program FilesLed"
- md "Ping Testor"
- )
- if not exist "C:Program FilesLedPing Testorversion"
- (
- cd "C:Program FilesLedPing Testor"
- md "version"
- )
- if not exist "C:Program FilesLedPing Testorversion1.7.info"
- (
- cd "C:Program FilesLedPing Testorversion"
- echo "1.7235 Release. Beta Officially Closed. More Information at LedDevelopment.CU.CC/main/products/led-ping-testor" >1.7.info
- )
- goto old
- rem Creates all necessary directories if they don't exist and adds version information to the directory.
- :old
- title Led Development AB 2015 - 2016
- color 0a
- mode con: cols=65 lines=18
- cls
- rem Window setup (Initial).
- :a
- echo Led Ping Testor v1.7235(R)
- 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.
- echo =============== ==========
- 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.
- echo.
- 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.
- rem Intro text.
- set /p op=
- if %op%== 1 goto ping1
- if %op%== 2 goto ping2a
- if %op%== log goto log
- if %op%== logclr goto logclr
- rem This checks for all eligible user input for this stage.
- goto old
- rem This takes user back to Main Screen in case of non-eligible input.
- :log
- cls
- if exist "C:Program FilesLedPing Testorlog.txt"
- (
- cd "C:Program FilesLedPing Testor"
- start log.txt
- )
- rem Opens log if exists.
- if not exist "C:Program FilesLedPing Testorlog.txt"
- (
- cls
- echo The log file is empty, thus cannot be openned.
- pause
- goto a
- )
- rem Gives error message if log doesn't exist.
- :logclr
- cls
- cd "C:Program FilesLedPing Testor"
- del log.txt
- goto old
- :ping1
- echo Please choose how many times you want to ping the host.
- set /p %numb%
- if %numb% < 1 goto ping1a
- if %numb% > 99999 goto ping1a
- rem Checks if user input was between 1 and 99999 to confirm user input as an interger (numbers only).
- cls
- rem If user input isn't an integer between 1 and 99999, error message explaining appears in a new window.
- msg %username% Warning: Not a numerical value between 1 and 99999. Please check your spelling and remove all letters, special characters and spaces.
- goto ping1
- :ping1a
- cls
- title Pinging 185.28.21.39...
- cls
- cd "C:Program FilesLedPing Testor"
- echo ========================================================= >>log.txt
- echo Host:185.28.21.39 Ping Count:%numb% >>log.txt
- echo Include this in any bug reports for the Ping Testor. >>log.txt
- echo %date% >> log.txt
- rem All this chunck of code above is the injection of data to the log file.
- :ping11
- echo Led Ping Testor
- echo ===============
- echo The ping is called time, and is displayed upon every loop.
- echo.
- ping 185.28.21.39 -n %numb% >>log.txt
- ping 185.28.21.39 -n %numb%
- ping localhost -n 2 >nul
- cls
- goto ping11
- rem And this chunck performs the same thing as above but infront of the user.
- 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.
- echo.
- 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.
- rem Intro text.
- set /p op=
- if %op%== 1 goto ping1
- if %op%== 2 goto ping2a
- if %op%== log goto log
- if %op%== logclr goto logclr
- rem This checks for all eligible user input for this stage.
- goto old
- rem This takes user back to Main Screen in case of non-eligible input.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement