| View previous topic :: View next topic |
| Author |
Message |
katpasin
Joined: 15 May 2006 Posts: 3 Location: India
|
Posted: Mon May 15, 2006 6:09 am Post subject: ping function |
|
|
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 |
|
 |
BoBo Guest
|
Posted: Mon May 15, 2006 6:23 am Post subject: |
|
|
| 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
|
Posted: Mon May 15, 2006 6:30 am Post subject: |
|
|
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 |
|
 |
BoBo Guest
|
Posted: Mon May 15, 2006 6:50 am Post subject: |
|
|
| 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
|
Posted: Mon May 15, 2006 6:58 am Post subject: |
|
|
| 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
|
Posted: Mon May 15, 2006 7:11 am Post subject: |
|
|
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 |
|
 |
yellowsix
Joined: 17 Nov 2006 Posts: 6
|
Posted: Fri May 11, 2007 10:05 am Post subject: |
|
|
I wouldn't count 1 time-out an error if maybe 3 make it to the target, but still a nice little script though.
Keep up the good work BoBo! I really appreciate all your nice little scripts and apps on the forums. I use them a lot.
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 |
|
 |
silveredge78
Joined: 25 Jul 2006 Posts: 387 Location: Midwest, USA
|
Posted: Fri May 11, 2007 10:57 pm Post subject: |
|
|
Personally, I like Alive 1.2 to check for pingability. I use it in my ServerCheck script. _________________ SilverEdge78 |
|
| Back to top |
|
 |
|