Hello friends, previously I told you about ping command for windows to test your link. Today, I am going to tell you about its batch file.
Batch files are basically those text files which has a .bat extension to their filename and when opens cmd.exe executes them sequentially as they appear in .file.
So, when continuous Ping batch file runs, cmd runs it and a log of this file is saved in another text file which is mentioned in batch file.The text follows as:
@echo OFF
@echo [Date Time] >>pinglog.txt
ping [IP/URL] -t>>pinglog.txt
Echo is a windows console command used for displaying message. Just type 'echo' in cmd to know its state (On/Off). To display any message, type echo followed by any message.
1. The echo state is made off to hide the following date and time command.
2. Enter current date and time, which will be displayed by echo command. This date and time will be displayed on the file 'pinglog.txt'. You can give any name here.
3. Next, enter the continuous ping command. The result will be saved in the mentioned 'pinglog.txt' file.
Copy the following command in a notepad and save it with a '.bat' file extension. I have saved it with pingcont.bat name. The results are saved in pinglog.txt file.
Here I tried to ping www.google.com. Note that, if you use the same file name for saving results for different IPs/URLs, results will be added to previous results. New result will NOT overwrite the previous one. I will recommend to save each result in new file.
No comments:
Post a Comment