Download securecrt.tlb type library
# $language = "VBScript"
# $interface = "1.0"
'Dim crt As SecureCrt.crt
' This script demonstrates one way to send a text file to a unix server
' This is equivalent to doing an "send ASCII" in a script.
' Constants used by OpenTextFile()
Const ForReading = 1
Const ForWriting = 2
' Create an instance of the filesystem object so we can open a file
' Note: A runtime exception will be generated if 'myfile.txt' doesn't exist.
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile("c:\temp\myfile.txt", ForReading, False)
' Send a 'cat' command to direct everything we are about to send into a file.
crt.Screen.Send "cat > output.txt" & vbCR
' The next line causes the script to wait until the 'cat' command has been
' sent (and executed) by the server. So that the data we're about to send
' doesn't get sent until redirected 'cat' command is actually in effect.
' Send the file a line at a time.
Do While file.AtEndOfStream <> True
str = file.Readline
crt.Screen.Send str & Chr(13)
' send an EOF character to end output to terminate 'cat'
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.
Copyright © 2001-2020 adersοft