#157426 - 2006-02-18 04:58 PM
Re: Telnet and Serial Connections
|
Les
KiX Master
   
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
Here is some code that does IP. Code:
break on
$=SetOption('Explicit','On') $=SetOption('WrapAtEOL','On')
Dim $oAutoIT,$IP,$Date
$Date = Split(@Date,"/") $Date = $Date[1]+'-'+$Date[2]+'-'+Right($Date[0],2)
; Create AutoIT object $oAutoIT = CreateObject('AutoItX3.Control') If @ERROR OR VarType($oAutoIt)<>9 'ERROR: Could not create AutoIt instance' ? Exit @ERROR EndIf
For $IP = 20 to 25 Run '"C:\Program Files\Windows NT\hypertrm.exe" /t 10.10.10.'+$IP ; Wait for Hyperterm window to appear... If Not CInt($oAutoIT.WinWait('10.10.10.'+$IP,'',5)) 'ERROR: Window took too long.' ? Else sleep 0.5 If Not CInt($oAutoIT.WinWait('10.10.10.'+$IP,'Connected',5)) $oAutoIt.Send('{ENTER}') Endif sleep 0.5 If Not CInt($oAutoIT.WinWait('10.10.10.'+$IP,'Connected',5)) $oAutoIt.Send('{ENTER}') sleep 0.5 Endif If Not CInt($oAutoIT.WinWait('10.10.10.'+$IP,'Connected',5)) 'ERROR: Hyperterm to 10.10.10.'+$IP+' took too long.' ? Else sleep 0.5 $oAutoIt.Send('ThisIsNotThePassword{ENTER}') sleep 1 $oAutoIt.Send('copy com "show tech mesh" tftp 10.10.10.10 '+$IP+'showmesh'+$Date+'.txt{ENTER}') sleep 1 $oAutoIt.Send('logout{ENTER}') sleep 0.2 $oAutoIt.Send('y') sleep 0.5 $oAutoIt.Send('!{F4}') sleep 0.5 $oAutoIt.Send('!n') EndIf EndIf Next
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|