Checking IP Address in my cmd

Hello guys
I am a starter. Can someone help me to find the logic and sample behind the checking ip address pings or not in cmd. How will the robot recognize that ip address pings or not.
Thank you

ping 10.100.x.x > results.txt

The outcome of ping will be saved in result.txt and you can open the file & search for specific key words like “Host not found” etc…

Hi @skini76 can please help me with the sample, I am just a starter in uipath, please help me.

Hey @Kuenzang

Hey You can either use it via code or by powershell too :slight_smile:

you have to use System.Net.NetworkInformation namespace then you can use:

Find below reference sample to ping a site either via website address or IPAddress

in below sample in Ipaddress variable you can either assign a website address or ip both will work :slight_smile:

and response will be like :slight_smile:

image
PingSample.xaml (6.6 KB)

You can check with status is success then ping is working otherwise not.

Let me know if you have any prob. :slight_smile:

Regards…!!
Aksh

3 Likes

Hey @Kuenzang

Sorry Forgot to attach look in the above edited post only :slight_smile:

Regards…!!
Aksh

1 Like

Thats a great help @aksh1yadav, and can I use ""Network Status : " + rply.Status.ToString +Environment.NewLine+ "Time : " + rply.RoundtripTime.ToString() +Environment.NewLine+“Address : " + rply.Address.ToString = “Success”” in If activity so that we can deploy in message box whether its success or not.

Hey @Kuenzang

That is just to show you you can use just with if rply.Status.ToString = "Success or not :slight_smile:

Regards.>!!
Aksh

When I tried to create in assign activity in “Value” I too asigned New Ping but it say error. It says “Compiler error(s) encountered processing expression “New Ping”, Type Ping is not difined.”, Can you please suggest what is the problem
Thank you.

Hey @Kuenzang

Check my sample you have to defined the data type of ping and as i mentioned earlier you have to import the namespace of System.Net.NetworkInformation in your import panel

Regards…!!
Aksh

1 Like

Thank you for your guidance.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.