-2
此VBSCRIPT代碼會引發800A0400錯誤。有什麼想法嗎?使用VBscript/Wscript進行Telnet復位
<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>