Hello, Im new using vbs and HTAs.. im want 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 'WshShell.SendKeys" or 'wscript.sleep', these functions dont work inside the HTA (It works when i make it a .vbs file). But how to get 'WshShell.SendKeys" or 'wscript.sleep' to work inside HTA..? 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 telnet
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "telnet" << Code works up to this point.
WScript.Sleep 1000
WshShell.SendKeys "o"
WshShell.SendKeys "{ENTER}"
End Sub
</script>
<body>
<input type="button" value="telnet" name="run_button" onClick="telnet">
</body>