Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTA Textbox

Status
Not open for further replies.

RobSzar

MIS
Mar 6, 2005
8
US
does anyone know how to create a textbox and perform an action when a button is clicked? example: a computer textbox, when you click a button it will ping the computer and return an IP
 
This sounds deceptively simple. What am I missing?

You just have an HTA with a "computer name" (DNS name?) textbox, a "ping" button, and in the click event handler for the button you ping the specified computer and report the results to a <DIV> or something.

The "obvious" way to do the ping is probably to WshShell.Exec a run of the command-line ping.exe utility and capture its response via stdOut. Other than that you'd need to look for an ActiveX "ping component" to invoke, like perhaps Ping ActiveX Control or similar.

We see a lot of "ping" questions here, maybe a search would turn something up. I don't find ping particularly useful myself, so many routers and firewalls are blocking or blackholing ICMP pings these days.

Do you really want to ping or simply to resolve names to IP addresses? For the latter you can execute nslookup.exe or possibly make use of the Winsock control depending on what you are doing.
 
Really I don't want to ping, that was just an example. I want to create a, HTA with a text field to enter data, then have a action button to run the script using whatever is in the text field as a variable. The ping was just an example. I want to create an HTA page where you enter the computer name click on the action button and it will gather computer info. the VBScript is already writen, I just can't get the variable = text field and the action button to run the script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top