Page 1 of 1

vbs gui button in HTA ...

Posted: Sun Jan 08, 2012 4:18 am
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>

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

vbs gui button in HTA ...

Posted: Sun Jan 08, 2012 4:18 am
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>

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

vbs gui button in HTA ...

Posted: Sun Jan 08, 2012 4:50 am
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/

vbs gui button in HTA ...

Posted: Sun Jan 08, 2012 9:02 am
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!