#73832 - 2003-03-17 11:47 PM
Re: The correct format.
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Ugh... #$%@^
Can't believe author of PostPrep don't use for his own code posting either.
Very easy to setup a link/shortcut to run it Jooel
I'm getting lazy. Even short code is much easier to copy from board when PostPrep is used.
Now where did I hide that Write/MS Word application?
|
Top
|
|
|
|
#73833 - 2003-03-18 01:19 AM
Re: The correct format.
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
This works on XP and 98...
code:
$junkfile = "%temp%\winscl.xxx" del $junkfile
shell '%comspec% /c ping -n 2 216.239.33.100 > $junkfile' $filehandle = FreeFileHandle ( ) If Open ($filehandle, $junkfile) = 0 $line = ReadLine ($filehandle) While @Error = 0 If InStr ($line, "Reply from") $replies = 1 Endif $line = ReadLine ($filehandle) Loop Endif $null = Close ($filehandle) del $junkfile
If $replies < 1 ? "Server not responding at this time" Else ? "The server is up" Endif
get $
|
Top
|
|
|
|
#73834 - 2003-03-18 01:28 AM
Re: The correct format.
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
Tried your snippet as well Lonkero. I also get ping successful on every address in win98, even though the "(0% loss)" should work...
code:
$ip="0.0.1.1" shell '%comspec% /c ping $ip | find "(0% loss)" >null' if @error "could not ping" else "ping succesfull" endif
[ 18. March 2003, 01:31: Message edited by: CitrixMan ]
|
Top
|
|
|
|
#73838 - 2003-03-18 11:36 PM
Re: The correct format.
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
Yea...What NTDoc said...
|
Top
|
|
|
|
#73839 - 2003-03-19 09:29 AM
Re: The correct format.
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#73841 - 2003-03-19 09:54 AM
Re: The correct format.
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#73845 - 2003-03-19 11:13 AM
Re: The correct format.
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 369 anonymous users online.
|
|
|