Page 1 of 1 1
Topic Options
#133127 - 2005-01-28 10:10 PM SetFocus/SetTitle Question
Fugazi Offline
Starting to like KiXtart

Registered: 2001-04-23
Posts: 142
Loc: Pace, Fl.
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.

Top
#133128 - 2005-01-28 10:33 PM Re: SetFocus/SetTitle Question
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
If you more closely examine the "Start" command, I think you will see that you can set the title of the window.
Code:

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]

"title" Title to display in window title bar.
path Starting directory
B Start application without creating a new window. The
application has ^C handling ignored. Unless the application
enables ^C processing, ^Break is the only way to interrupt
the application
I The new environment will be the original environment passed
to the cmd.exe and not the current environment.
MIN Start window minimized
MAX Start window maximized
SEPARATE Start 16-bit Windows program in separate memory space
SHARED Start 16-bit Windows program in shared memory space
LOW Start application in the IDLE priority class
NORMAL Start application in the NORMAL priority class
HIGH Start application in the HIGH priority class
REALTIME Start application in the REALTIME priority class
ABOVENORMAL Start application in the ABOVENORMAL priority class
BELOWNORMAL Start application in the BELOWNORMAL priority class
WAIT Start application and wait for it to terminate
command/program
If it is an internal cmd command or a batch file then
the command processor is run with the /K switch to cmd.exe.
This means that the window will remain after the command
has been run.

If it is not an internal cmd command or batch file then
it is a program and will run as either a windowed application
or a console application.

parameters These are the parameters passed to the command/program

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#133129 - 2005-01-28 10:40 PM Re: SetFocus/SetTitle Question
Fugazi Offline
Starting to like KiXtart

Registered: 2001-04-23
Posts: 142
Loc: Pace, Fl.
Thanks Howard I have not looked at the Help on start in to long obviously since more switches have been added.

New Run code

Code:

Run '%comspec% /c start '+'"'+$server+'" telnet.exe '+$server


_________________________
I haven't failed. I just found another way that did not work.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2375 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.087 seconds in which 0.057 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org