Button in HTML to open CMD and ping a certain IP address.

Basically it is like this, I have a page that has information on it that was called from a DB. Part of that info was an IP address. I need to be able to open up CMD.exe using a HTML button and pass the "ping" and the ip address to it.

Any ideas on how to accomplish this?

(I tried posting this to the ASP group with no luck)
LVL 6
cjinsocal581Asked:
Who is Participating?
 
softplusConnect With a Mentor Commented:
0
 
ZylochCommented:
Hi cjinsocal581,

Doubtful you can do it with straight HTML and even Javascript.

What you can do is ping using a server-side language like ASP. I do not know ASP, but I know you can use the system() function or backticks in PHP, something like:

`ping [ip address]`

Regards,
Zyloch
0
 
BatalfCommented:
I think the solution with be to create a server side scripts that pings the ip address. Then the result of that ping could be outputted from that script back to the browser

I'm not familiar with ASP, but in PHP I would probably have created a link like this:

<a href="pingScript.php">Ping server</a>

and the pingScript.php could be like this:

<?php

system("(ping 127.0.0.1)2>&1");

?>


I'm sure that ASP have a similar function.

Batalf
0
 
cjinsocal581Author Commented:
ASP is the way I need to go on this one. Thanks all... You are always the best.
0
 
BatalfCommented:
Wow ! So much activitity a friday night - I didn't see the previous post when I started evaluating this Q.

Batalf
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.