AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ping function

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
katpasin



Joined: 15 May 2006
Posts: 3
Location: India

PostPosted: Mon May 15, 2006 6:09 am    Post subject: ping function Reply with quote

is there any ping function in AHK? culdnt find it in the documentation.

i need to juz ping a comp in my lan and get its status .i.e connectable or not-connectable. tats all

if thr is no ping func, is thr any alternative??
Back to top
View user's profile Send private message Yahoo Messenger
BoBo
Guest





PostPosted: Mon May 15, 2006 6:23 am    Post subject: Reply with quote

Code:
Target = www.autohotkey.com/forum/index.php
Run, cmd /c ping %Target% > MyPing.log
FileRead, FileContent, MyPing.log
If FileContent not contains TimeOut ; or another error
   MsgBox, good chance that XYZ is alive and kickin !
FileDelete, MyPing.log
Untested.
Back to top
katpasin



Joined: 15 May 2006
Posts: 3
Location: India

PostPosted: Mon May 15, 2006 6:30 am    Post subject: Reply with quote

thnx for the help bobo,

tat script works wen the connection is alive, but doesnt work in case other comp is offline.
Back to top
View user's profile Send private message Yahoo Messenger
BoBo
Guest





PostPosted: Mon May 15, 2006 6:50 am    Post subject: Reply with quote

Quote:
that script works wen the connection is alive
... which means is connectable, isn't it ?

Connectable means could be mapped as an additional drive?
Back to top
BoBo
Guest





PostPosted: Mon May 15, 2006 6:58 am    Post subject: Reply with quote

Quote:
DriveGet
--------------------------------------------------------------------------------
Retrieves various types of information about the computer's drive(s).

DriveGet, OutputVar, Cmd [, Value]

Status, Path: Retrieves Path's status, which is one of the following words: Unknown (might indicate unformatted/RAW), Ready, NotReady (typical for removable drives that don't contain media), Invalid (Path does not exist or is a network drive that is presently inaccessible, etc.)
Back to top
katpasin



Joined: 15 May 2006
Posts: 3
Location: India

PostPosted: Mon May 15, 2006 7:11 am    Post subject: Reply with quote

thnx bobo. ur prev script fully solved my prob wit a lil mod

Code:
Target = 80.247.148.142 -n 1 -w 250
Run, cmd /c ping %Target% > MyPing.log
FileRead, FileContent, MyPing.log
If FileContent not contains timed out ; or another error
   MsgBox, good chance that XYZ is alive and kickin !
else
MsgBox, good chance that XYZ is dead and rollin !




i needed tis script to test if i am connected to my isp server. if disconnected thn, relog in. got all other parts. juz needed the ping part.

thnx again.!!
Back to top
View user's profile Send private message Yahoo Messenger
yellowsix



Joined: 17 Nov 2006
Posts: 6

PostPosted: Fri May 11, 2007 10:05 am    Post subject: Reply with quote

I wouldn't count 1 time-out an error if maybe 3 make it to the target, but still a nice little script though. Very Happy
Keep up the good work BoBo! I really appreciate all your nice little scripts and apps on the forums. I use them a lot. Surprised

Yellowsix

[EDIT]

Hey I just found out that ping sets the program exit code. So it sets ErrorLevel when using RunWait. Might be useful.
Back to top
View user's profile Send private message
silveredge78



Joined: 25 Jul 2006
Posts: 387
Location: Midwest, USA

PostPosted: Fri May 11, 2007 10:57 pm    Post subject: Reply with quote

Personally, I like Alive 1.2 to check for pingability. I use it in my ServerCheck script.
_________________
SilverEdge78
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group