Use vbscript and Telnet to Reboot SGE2000P Switch

This can possible work on other switches to with some modifications.  Since this switch allows telnet I first used telnet to manually reboot and noted each keypress.   Connect to the switch with Shell.Run and proceed with the commands using SendKeys.  There is a nice reference to SendKeys here   The sleep commands give the switch some time to draw the new screen.

 

‘ Open Telnet and connect to 82.101.68.207
set WshShell = WScript.CreateObject(“WScript.Shell”)
WshShell.run(“telnet.exe 10.1.10.4″)
‘ Wait 500 ms
WScript.Sleep 500
‘Username
WshShell.SendKeys”admin”
WshShell.SendKeys(“{Tab}”)
WScript.Sleep 500

‘Password
WshShell.SendKeys”admin”
WshShell.SendKeys(“{Enter}”)
WScript.Sleep 500
‘System Configuration
WshShell.SendKeys(“{Enter}”)
WScript.Sleep 500
‘Go down to reboot, 9 down arrows
for t=1 to 9
WshShell.SendKeys(“{DOWN}”)
WScript.Sleep 500
Next

WshShell.SendKeys(“{Enter}”)
WScript.Sleep 500