1.

Solve : Help with batch file [costum message]?

Answer»

so....

I am making a "go-to-program-shortcut-file" -->[.bat] (for now still in work...)

and i need some help.
Is it possible to CHANGE the "ping message" ? ? ?


I would like it to not display


pinging google.com [ip] with . . .
Reply from [ip] bytes=32 . . .
Reply from [ip] bytes=32 . . .
Reply from [ip] bytes=32 . . .
Reply from [ip] bytes=32 . . .




I want it to display something like

Pinging google.com
connection status : connected (or disconnected)
your ping is [ping] (if the user has internet connection)




I appreciate any kind of help . . .
Thank you for support.


Aljax




Your output is going to be sort of worthless for troubleshooting.

Your chopping out the most important FEATURE of Ping which is latency info and failed Ping count which you want to see 0% loss. From looking at what you want. It could say that your connected but yet you could have a major network issue going on.
Quote

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\dave>ping 127.0.0.1

Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Users\dave>

Trying to understand why Ping as it is is not good enough?

As far as shaping the output to say WHATEVER you want, it can be done, but not in real time. There would be a slight delay in what is measured and then what is parsed as the output to the display. To get rid of this delay would require writing your own Ping program so that the output is as you want it without having to reshape it to an alternate display layout to user.it is ok if there is a little delay . . .
goes fine with me
soooo
can you learn me something ?

[say yes XD]

if yes, is it possible to send a personal message on this forum [ill paste in my code so if you want, you can help me a bit]
I agree with Dave, but if you must do it then try this

By the way, no PMs, whatever help you get or don't get is here in the THREAD that you started.

Code: [Select]@echo off
SET host=www.google.com
echo Pinging %host%
set status=disconnected
ping -n 1 %host%>nul && set status=connected
echo Connection status : %status%
if "%status%"=="connected" for /f "tokens=1-7 delims== " %%A in ('ping -n 1 %host% ^| find "Reply from"') do echo Your ping is %%G
The output was:

Code: [Select]Pinging www.google.com
Connection status : connected
Your ping is 21msThank you man
appreciate that . . .
Ill send you finished version
score it from 1 to 5 please and tell me what you think i should add in .
thnx again 4 reply and support
and "PMs"
what is this ?
i'm from Slovenija so i don't know much about English spech shortcustQuote from: aljax
and "PMs"???what is this ?

Quote from: aljax
if yes, is it possible to send a personal message on this forum [ill paste in my code so if you want, you can help me a bit]
Thanks everybody [two man] who replied so fast and with great support


Discussion

No Comment Found