# Ping program



## tech-it-^ (Aug 18, 2006)

Hello,

I am trying to write a program on how to automate a pinging process. I just want to be able to copy an IP address off of one excel page, then be able to paste in cmd prompt and ping it and then have it switch back to the excel page and enter in if it resolved or not. Can anyone help me with this? I was thinking of writing an autohotkey script but... I am not sure how to make the program figure out if it pinged or not. PLEASE help!


----------



## jamiemac2005 (Jul 5, 2007)

Hey, why an exel page? could you not use a batch file &/ some text input?

Autohotkey does sound alright for it, you could use the Autohotkey script recorder for most of it.... As for working out whether it has worked or not, you could probably use an input to file thing(sorry that wont make sence i can't remember the correct name right now)... so that the ping command becomes something like "ping [ipAddress] > temp.text" then open it (/read it) using FileRead(http://www.autohotkey.com/docs/commands/FileRead.htm), then use IntStr(http://www.autohotkey.com/docs/Functions.htm#BuiltIn[scroll down]) to find out if the file contains the string "recieved 100%" (or whatever it is)...

Cheers,
Jamey


----------



## shuuhen (Sep 4, 2004)

A language like Ruby, Python or Perl would be perfect for this, but you'd have to learn one of the languages. I've never used Autohotkey (looks to be Windows-specific?), so I can't say how easy or hard this would be with it.

Instead of using an Excel spreadsheet, consider using a CSV (Excel can save spreadsheets as those). CSV's are generally easy to handle in programming languages and spreadsheet programs can open them up.


----------



## tech-it-^ (Aug 18, 2006)

alright, yeah I'm not to familiar with Ruby and I don't know of the syntax for python. Thanks guys, I've made a nice AutoIT script. Yes, it is windows specific but AutoIT is nice because it can run on just about any Windows machine. Anyway, thanks guys I appreciate the response. 

I'll have to look into those other languages, I only know java really, I kind of want to dabble in C# and C++ because I think those languages could help me with simple stuff like this to and more. Anyway, thanks again guys.


----------

