使用 VBscript / Wscript 进行 Telnet 重置
此 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>
This VBSCRIPT code throws a 800A0400 error. Any thoughts?
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过在 google 上查找您收到的错误代码或脚本文件 XML 语法?您缺少
根元素,并且文件扩展名可能错误(应为 .wsf)。Have you tried to google for the error code you are getting or for script file XML syntax? You are missing
<package>
root element and probably you have wrong file name extension (should be .wsf).