I am working on a script that will automate some of the telnet commands for Tivoli. I can have multiple telnet sessions open at one time which the title will have C:\WINNT\system32\telnet.exe on all of the sessions. Is it possible to set the title for each of these sessione that I am running in a seperate window? So I can SetFocus on that window.
Code:
Function telnet()
CLS
$svr="server1","server2","server3"
$option=0
$loc=2
$optnum=1
CLS
For Each $server in $svr
At ($loc,25) Color g+/n "["+ $optnum+"] " Color m+/n $server
$optnum=$optnum+1
$loc=$loc+1
Next
Do
At ($loc+2,25) Color g+/n "[X] " Color m+/n $"Exit"
At ($loc+4,27) "Please Select Server" Get $telsvr
Until $telsvr > 0 OR $telsvr < 4
Select
Case $telsvr=1
$server="server1"
Case $telsvr=2
$server="server2"
Case $telsvr=3
$server="server3"
Case $telsvr = "x"
Return
EndSelect
?"Enter Telnet Password: " Color n/n Gets $pwd
Run "%comspec% /c start telnet.exe "+$server
Sleep 2
SendKeys (Lcase(@USERID+"{ENTER}"))
Sleep 2
SendKeys ($pwd+"{ENTER}")
Sleep 1
SendKeys ("cd ..{ENTER}")
EndFunction
I would like to thank Jooel for giving me the idea with his SendMail() UDF
_________________________
I haven't failed. I just found another way that did not work.