Sample scripts

SecureCrt

Download securecrt.tlb type library


# $language = "VBScript"
# $interface = "1.0"

'library:c:\mytypelib\securecrt.tlb
'Dim crt As SecureCrt.crt

' This script demonstrates how to open a text file and it line by
' line to a server.

' Constants used by OpenTextFile()
'
Const ForReading = 1
Const ForWriting = 2

Sub Main

  Dim fso, file, str
  Set fso = CreateObject("Scripting.FileSystemObject")

  ' Note: A runtime exception will be generated if 'input.txt' doesn't exist.
  '
  Set file = fso.OpenTextFile("c:\temp\input.txt", ForReading, False)

  crt.Screen.Synchronous = True

  DoWhile file.AtEndOfStream <> True

    str = file.Readline

    ' Send the line with an appended CR
    '
    crt.Screen.Send str & Chr(13)

    ' Wait for my prompt before sending the next line
    '
    crt.Screen.WaitForString"prompt$"
  Loop

  crt.Screen.Synchronous = False

EndSub


VbsEdit provides Intellisense for SecureCRT!


This package includes VbsEdit 32-bit, VbsEdit 64-bit, HtaEdit 32-bit and HtaEdit 64-bit.
The evaluation version never expires.




Home  

Copyright © 2001-2017 Adersoft