Have tried knocking this little script up this morning, it kinda works except you can't cancel out of it if you want to...what am I missing? Something in the Loop or the If statement is ruining it I think...
Code:
'Simple script to open a telnet session with a chosen server
Option Explicit
Dim objShell, intCount, strServer, strInput
' Input Box to get name of server to connect to
'Do
strServer = (InputBox(" Server to connect to:", "CRT Replacement"))
If strServer <> "" Then
strInput = True
End if
'Loop until strInput = True
'Open command prompt
Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd"
WScript.Sleep 1000
objShell.AppActivate "C:\windows\system32\cmd.exe"
'send relevant commands to window.
objShell.SendKeys "telnet"
objShell.SendKeys "{ENTER}"
objShell.SendKeys "o "
objShell.SendKeys strServer
objShell.SendKeys "{ENTER}"