Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Ping bat file  (Read 24120 times)

0 Members and 1 Guest are viewing this topic.

Helpmeh



    Guru

  • Roar.
  • Thanked: 123
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Familiar
  • OS: Windows 8
Re: Ping bat file
« Reply #15 on: April 08, 2009, 03:43:53 PM »
No, but every time I changed the content of the bat file I didn’t see the change (example I changed the Ip address in 127.0.0.1 but it still goes to www.whatever.com)
Than I created a new folder and moved the bat file there. After the changes of folders, the bat file works.


I personally ping LOCALHOST instead of 127.0.0.1, although they do the same thing (HOSTS file).
Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.

daywalkerz

  • Guest
Re: Ping bat file
« Reply #16 on: November 27, 2009, 12:46:27 PM »
Hallo,

I want to make a bat file that performs a ping action.
If the result is request time out than the bat file time.bat has to be activated. The time.bat enters the time that the ping action has failed.
EXAMPLE of ping.bat:
:start
ping www.google.nl -n 20 
(After this I don’t now what to do?)
CALL time.bat
GOTO start


EXAMPLE of time.bat:
echo.|TIME >> C:\ping\Data.txt (the time will be enter in the text file Data.txt

Can somebody help me with a function that will activate the time.bat only when there is a request time out?


hii there..im just newbe here...hope this will solve your problems.
try this code:
Code: [Select]
@echo off
color 0A
title PING TEST By DAYWALKERZ
echo.
echo.
:start
echo. >> C:\ping\Data.txt
echo. TIME>> C:\ping\Data.txt
echo  Date: %date%  Time:%time% *START PING >> C:\ping\Data.txt
echo.
echo STARTING PING TEST...
echo *********************
echo.
echo Date: %date% 
echo Time: %time%
ping google.nl -n 4 |find "Request timed out." && (goto A)
ping localhost -n 60 >nul
goto start
:A
echo  Date: %date%  Time: %time% *PING FAILED >> C:\ping\Data.txt
ping localhost -n 30 >nul
goto start

ok here the tips.

1st - make sure that you make empty folder on where ever location on your hardrive that called "ping"
example:
Code: [Select]
C:\ping
2nd - dont put the www infront of the ping site
example:
Code: [Select]
ping google.nl
3rd - do not ping to long...waste a time ... just make short pings only.
example:
Code: [Select]
ping google.nl -n 4
4th - timer for every pings. here i set it for 60 sec every ping.you may set it what ever you liked.
example:
Code: [Select]
ping localhost -n 60 >nul
5th - call or goto, if you call its will popup or runs what you have set.you also may change it what ever you wants.
example:
Code: [Select]
|find "Request timed out." && (goto A)
- if you wanna call your file such "time.bat"...just change it to "CALL time.bat".but make sure you already make batch file for "time.bat" and make sure you get it full location of it.
example:
Code: [Select]
|find "Request timed out." && (CALL C:\time.bat)

sample picture:

cmd:


log file:


hopefully will help you solve your problems....
sorry for my broken language...

Salmon Trout

  • Guest
Re: Ping bat file
« Reply #17 on: November 27, 2009, 12:51:20 PM »
hii there..im just newbe here...hope this will solve your problems.

This thread died 7 months ago!