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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.