Page 1 of 1

PING pc with FWH

Posted: Mon Dec 06, 2021 11:05 am
by Marc Vanzegbroeck
Hi,

Is is possible to ping with FWH to see if an IP exist or not?

The problem is that that I have a client that is connected with VPN to the SQL-database on the server.
Sometimes he want to work on the same place as where the server is connected, but than he have to connect to the SQL-database with another IP-adres.

I know I can configure the network that the server is always having the same IP.
But it would be easyer to check if the IP exist or not in this case, since I'm not the administrator of that network.

What also could help if to know on what public IP the PC is connected (like www.whatismyip.com), than I also know if he's connected on the network of the server of not.

Re: PING pc with FWH

Posted: Mon Dec 06, 2021 11:21 am
by cmsoft
This is an external solution but it can be useful.

Code: Select all | Expand


nResp := WinExec( "pin.bat",0)
cText := Memoread("c:ping.txt")
IF "no pudo encontrar"$cText .or. "General failure"$cText      
    //Here is your code for when that IP is not available
ENDIF
 

This is the content of the file pin.bat

Code: Select all | Expand


ping 192.168.1.1 -n 1 > ping.txt
 

I hope it helps you.

Re: PING pc with FWH

Posted: Mon Dec 06, 2021 11:30 am
by Marc Vanzegbroeck
Thank you Cesar, I will try this.

Re: PING pc with FWH

Posted: Mon Dec 06, 2021 11:46 am
by Baxajaun

Re: PING pc with FWH

Posted: Mon Dec 06, 2021 12:37 pm
by cmsoft
Mucho mejor!