MrsMopey
Programmer
- Jul 31, 2007
- 19
Hi,
I am trying to open a cmd prompt from an HTML page. I want to be able to log in to a telnet session, pass two variables from textboxes on the HTML form and execute a command. So far this is what I have:
I can't get it to work. It stops after the first line. What am I doing wrong?
Thanks,
I am trying to open a cmd prompt from an HTML page. I want to be able to log in to a telnet session, pass two variables from textboxes on the HTML form and execute a command. So far this is what I have:
Code:
<HTML>
<HEAD>
<TITLE>
Reset SX User
</TITLE>
<SCRIPT LANGUAGE="vbscript">
OPTION EXPLICIT
Sub cmdReset_OnClick
Dim txtUserID
Dim txtCoNo
Dim objShell
txtUserID = frmForm1.txtUserID.Value
txtCoNo= frmForm1.txtUserID.Value
Set objShell = CreateObject("wscript.Shell")
objShell.Run "%comspec% /k telnet volmrs"
objShell.SendKeys "root" [b][COLOR=red]<<<<< it stops here >>>[/color red][/b]
objShell.SendKeys "{ENTER}"
wscript.sleep(50)
objShell.SendKeys "fff"
wscript.sleep(100)
objShell.SendKeys "{ENTER}"
wscript.sleep(10)
objShell.SendKeys "Shut User " & txtCoNo & txtUserID
objShell.SendKeys "{ENTER}"
End Sub
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white">
<FONT FACE="arial" SIZE=2><B>
<CENTER>
<H3>Reset SX User</H3>
<P>
Enter the UserID and Company number of the person you would like to reset in SX.
</P>
<FORM NAME="frmForm1">
User ID
<INPUT TYPE="text" NAME="txtUserID" SIZE=10>
<P>
<INPUT TYPE="button" NAME="cmdReset" VALUE="Reset">
<P>
Company Number
<INPUT TYPE="text" NAME="txtCoNo">
</FORM>
</BODY>
</HTML>
I can't get it to work. It stops after the first line. What am I doing wrong?
Thanks,