使用VBscript/Wscript重置Telnet

使用VBscript/Wscript重置Telnet,vbscript,telnet,wsh,Vbscript,Telnet,Wsh,此VBSCRIPT代码引发800A0400错误。有什么想法吗 <job> <script language="VBScript"> Option Explicit On Error Resume Next Dim WshShell set WshShell=CreateObject("WScript.Shell") WshShell.run "cmd.exe" WScript.Sleep 500 'Send commands to the window as needed

此VBSCRIPT代码引发800A0400错误。有什么想法吗

<job>
<script language="VBScript">
Option Explicit
On Error Resume Next
Dim WshShell
set WshShell=CreateObject("WScript.Shell")
WshShell.run "cmd.exe"
WScript.Sleep 500
'Send commands to the window as needed - IP and commands need to be customized
'Step 1 - Telnet to remote IP'
WshShell.SendKeys "telnet 123.456.789.01"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Step 2 - Issue Commands with pauses'
'USERNAME
WshShell.SendKeys "USERNAMEHERE"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'PASSWORD
WshShell.SendKeys "PASSWORDHERE"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'RESET
WshShell.SendKeys "reset"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'CONFIRM
WshShell.SendKeys "y"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Step 3 - Exit Command Window
WshShell.SendKeys "exit"
WshShell.SendKeys ("{Enter}")
WScript.Quit 
</script>
</job>

选项显式
出错时继续下一步
昏暗的地狱
设置WshShell=CreateObject(“WScript.Shell”)
WshShell.run“cmd.exe”
WScript.Sleep 500
'根据需要向窗口发送命令-需要自定义IP和命令
“步骤1-Telnet到远程IP”
WshShell.SendKeys“telnet 123.456.789.01”
WshShell.SendKeys(“{Enter}”)
WScript.Sleep 500
'步骤2-发出暂停命令'
'用户名
WshShell.SendKeys“USERNAMEHERE”
WshShell.SendKeys(“{Enter}”)
WScript.Sleep 500
'密码
WshShell.SendKeys“PASSWORDHERE”
WshShell.SendKeys(“{Enter}”)
WScript.Sleep 500
“重置
WshShell.SendKeys“重置”
WshShell.SendKeys(“{Enter}”)
WScript.Sleep 500
"证实,
WshShell.SendKeys“y”
WshShell.SendKeys(“{Enter}”)
WScript.Sleep 500
'步骤3-退出命令窗口
WshShell.SendKeys“退出”
WshShell.SendKeys(“{Enter}”)
WScript.Quit

您是否尝试在谷歌上搜索所获取的错误代码或脚本文件XML语法?您缺少
根元素,并且可能有错误的文件扩展名(应该是.wsf)