vbs gui button in HTA ...

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 12 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
kronix1
Posts: 3
Last visit: Sun Jan 08, 2012 7:22 pm

vbs gui button in HTA ...

Post by kronix1 »

Hello, Im new using vbs and HTAs.. im trying to make an HTA button that will send keys to telnet . I can make subroutine to open telnet with success.. However when I attempt to add the 'sendkeys' or 'wscript.sleep', these functions dont work. How to get around this..? I hear it is not possible, but i'm sure theres a way around this.. any
suggestions on how to make a gui button to send keys to telnet.. ??




THANKS! -

*********************

<head><title>SRAM SORT Test</title><HTA:APPLICATION APPLICATIONNAME="SRAM ETEST Test" SCROLL="yes" SINGLEINSTANCE="yes" WINDOWSTATE="max"></head>
<script language="VBScript"> Sub telnetSet WshShell = WScript.CreateObject("WScript.Shell") Set objShell = CreateObject("Wscript.Shell")objShell.Run "telnet" << Code works up to here.

WScript.Sleep 1000
WshShell.SendKeys "o"WshShell.SendKeys "{ENTER}"
End Sub</script> <body><input type="button" value="telnet" name="run_button" onClick="telnet"> </body>

***********************************
User avatar
kronix1
Posts: 3
Last visit: Sun Jan 08, 2012 7:22 pm

vbs gui button in HTA ...

Post by kronix1 »

Hello, Im new using vbs and HTAs.. im trying to make an HTA button that will send keys to telnet . I can make subroutine to open telnet with success.. However when I attempt to add the 'sendkeys' or 'wscript.sleep', these functions dont work. How to get around this..? I hear it is not possible, but i'm sure theres a way around this.. any
suggestions on how to make a gui button to send keys to telnet.. ??




THANKS! -

*********************

<head><title>SRAM SORT Test</title><HTA:APPLICATION APPLICATIONNAME="SRAM ETEST Test" SCROLL="yes" SINGLEINSTANCE="yes" WINDOWSTATE="max"></head>
<script language="VBScript"> Sub telnetSet WshShell = WScript.CreateObject("WScript.Shell") Set objShell = CreateObject("Wscript.Shell")objShell.Run "telnet" << Code works up to here.

WScript.Sleep 1000
WshShell.SendKeys "o"WshShell.SendKeys "{ENTER}"
End Sub</script> <body><input type="button" value="telnet" name="run_button" onClick="telnet"> </body>

***********************************
User avatar
rasimmer
Posts: 182
Last visit: Fri Apr 25, 2014 7:00 am

vbs gui button in HTA ...

Post by rasimmer »

I would say to first remove the HTA aspect of it and find VBScript code for Telnet. The HTA is just adding added complexity, you need base Telnet code in VBScript. In addition, .SendKeys is never really a viable solution because the correct item has to be active in the correct field (if applicable) and all it takes is for another application to be activated, you to click somewhere else on the screen because .SendKeys is just sending keystrokes to whatever is active on the screen. I don't believe there is a default .COM component in Windows to send commands to TFTP, you have to use a 3rd party component. Take a look at this and get the vbScript code working with static entries and if you want to know how to do HTA integration, post your HTA and attempt and a member can assist: http://www.activexperts.com/activsocket/objects/tftp/
User avatar
kronix1
Posts: 3
Last visit: Sun Jan 08, 2012 7:22 pm

vbs gui button in HTA ...

Post by kronix1 »

So at work we use telnet.. I have various scripts written in .vbs files...

These scripts do various tasks and look-up logs in our file system..
$ tail -300 var/opt/SPECS/log/data.log

another telnet example::

$ cd /var/opt/hp4070/data)

one more example:

$ tail -300 /var/opt/hp4070/diag/log
...................................................................

I want to make a GUI where i dont ave to type these commands in telnet .. where there is just an array of buttons and BAM there goes one script and Boom there goes the other ... No more typing these long strings.. Buttons, a gui interface to send these commands into telnet .

Any language .... How can this be achieved.>?
WHat is a good starting point ../ ?

Thanks!
This topic is 12 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked