| 
| 
| 
| #73807 - 2003-02-28 04:40 PM  The correct format. |  
| Microcyb   Getting the hang of it
 
   Registered:  2002-12-30
 Posts: 95
 Loc:  Hell
 | 
O.K. I tend to hate this, but here is goes.Does anyone know the correct format of the following command to use in Win9x, and not NT/2k
 
 c:\winnt\system32\cmd.exe /Q /E:1024 /C FOR /F "TOKENS=2* DELIMS= " %%i IN ('"PING -a -n 1 216.239.51.100 | FIND "]""') DO ECHO %%i >c:\report.txt
 pause
 
 This will work in a NT format, but get an invalid switch for Win9x.
 
 Sad thing is that I cannot find out where that invalid witch is.
 
 Any Clues????
 |  
| Top |  |  |  |  
| 
| 
| #73809 - 2003-02-28 04:53 PM  Re: The correct format. |  
| Microcyb   Getting the hang of it
 
   Registered:  2002-12-30
 Posts: 95
 Loc:  Hell
 | 
LOL yes I know that c:\windows\command.com, and c:\winnt]system32\cmd.exe are the two different ones.Thanks for pointing that out LLigetfa.
 
 I do have %comspec% in the Kix script, and then pulling the result, to display the information.
 
 Al that works, but here is the main issues I have.
 
 SHELL '%Comspec% /Q /E:1024 /C FOR /F "TOKENS=2* DELIMS= " %%i IN ('+ CHR(39)
 + '"PING -a -n 1 $ipnum | FIND "]""' + CHR(39) + ') DO ECHO %%i >' + $tempfile
 
 Only works in a NT/2K/XP enviorment.
 
 DOS only tells me I have an inavlid switch on a WIN9X platform.
 
 And for the life of me I cannot find that stupid invalid switch.
 ![[Mad]](images/icons/mad.gif)  
 In short I was just trying to ping two IP's
 One is google.com, and the other is behind a vpn.
 
 Wanted to know the results of the two so that I can know if the user is logged onto the ISP, and then the VPN.
 
 Using Watlz function this is what I have:
 
 code:It works just right, but only on a NT platform.
  ? REVPING("1.1.100.229")? @error
 ? REVPING("216.239.51.100")
 ? @error
 ? "DONE"
 get $
 
 FUNCTION REVPING($ipnum)
 DIM $nameip, $tempfile
 $tempfile = "%temp%\nameip.txt"
 
 SHELL '%Comspec% /Q /E:1024 /C FOR /F "TOKENS=2* DELIMS= " %%i IN ('+ CHR(39)
 + '"PING -a -n 1 $ipnum | FIND "]""' + CHR(39) + ') DO ECHO %%i >' + $tempfile
 
 IF OPEN(10,$tempfile,2) = 0  $nameip = READLINE(10)
 ELSE  $nameip = ""
 ENDIF
 IF CLOSE(10) = 0
 DEL $tempfile
 ENDIF
 IF $nameip <> "" $revping = TRIM($nameip)
 EXIT (0)
 ELSE		 $revping = "UNRESOLVED"
 EXIT (1)
 ENDIF
 ENDFUNCTION
 ![[Embarrassed]](images/icons/blush.gif)  
 So Hopefully some OLD SCHOOL people can tell me what the hell is the invalid switch.
 ![[Big Grin]](images/icons/grin.gif)  |  
| Top |  |  |  |  
| 
| 
| #73811 - 2003-02-28 04:56 PM  Re: The correct format. |  
| Jochen   KiX Supporter
 
       
   Registered:  2000-03-17
 Posts: 6380
 Loc:  Stuttgart, Germany
 |  |  
| Top |  |  |  |  
| 
| 
| #73812 - 2003-02-28 05:05 PM  Re: The correct format. |  
| Microcyb   Getting the hang of it
 
   Registered:  2002-12-30
 Posts: 95
 Loc:  Hell
 | 
Ahh O.K. jpols is de man to ask!Your Ping() function also for a NT platform. it does in fact work perfect, and I do not reallt care about the DNS hostname conversion.
 
 Here is the challenege for the day.
 Can you, or is it possible to ping the followng IP's in a WIN9X platform:
 VPN 1.1.100.229
 PUBLIC 216.239.51.100
 and just say true or false if it connected to the IP's or not?
 |  
| Top |  |  |  |  
| 
| 
| #73815 - 2003-02-28 05:13 PM  Re: The correct format. |  
| Microcyb   Getting the hang of it
 
   Registered:  2002-12-30
 Posts: 95
 Loc:  Hell
 | 
Ahhhh Gaming gooood....  ![[Smile]](images/icons/smile.gif)  
 But just want to do like this in DOS
 ping 216.239.51.100
 
 but in KIX how can you do that?
 
 In short I just wanted to know if you pinged an ip it could tell you yeah I can see it, or NOPE cannot see that ip, so that the rest of my script will continue or not.
 
 So if the script or a function could just outpu true or false the the IP in the request.
 |  
| Top |  |  |  |  
| 
| 
| #73818 - 2003-02-28 05:26 PM  Re: The correct format. |  
| Microcyb   Getting the hang of it
 
   Registered:  2002-12-30
 Posts: 95
 Loc:  Hell
 |  |  
| Top |  |  |  |  
| 
| 
| #73821 - 2003-03-03 08:15 PM  Re: The correct format. |  
| Jochen   KiX Supporter
 
       
   Registered:  2000-03-17
 Posts: 6380
 Loc:  Stuttgart, Germany
 |  |  
| Top |  |  |  |  
| 
| 
| #73822 - 2003-03-17 07:01 PM  Re: The correct format. |  
| Microcyb   Getting the hang of it
 
   Registered:  2002-12-30
 Posts: 95
 Loc:  Hell
 | 
Yep still around, and still no luck
 |  
| Top |  |  |  |  
| 
| 
| #73824 - 2003-03-17 07:39 PM  Re: The correct format. |  
| Microcyb   Getting the hang of it
 
   Registered:  2002-12-30
 Posts: 95
 Loc:  Hell
 | 
Well, not sure but every ping no matter if it is a bad ip or a good ip, says ping sucessfull.
 so if I ran your script to ping 0.0.1.1 it says it pinged, and if you place in a good ip, it says the same result.
 |  
| Top |  |  |  |  
| 
| 
| #73826 - 2003-03-17 08:49 PM  Re: The correct format. |  
| Microcyb   Getting the hang of it
 
   Registered:  2002-12-30
 Posts: 95
 Loc:  Hell
 | 
Still says ping succesfull even for a bad ip address.
 |  
| Top |  |  |  |  
 Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
 
 | 
| 
 
| 0 registered
and 766 anonymous users online. 
 | 
 |  |