# $language = "VBScript" # $interface = "1.0" ' This script sets a specific logfile, enables logging then connects ' to a server. After capturing the output of a command to the logfile ' logging is disabled and it disconnects. Sub Main ' Set the name of the log file name "YYMMDD.log" ' Dim logfile logfile = "C:\TEMP\mysession.log" crt.Session.LogFileName = logfile ' Enable logging ' crt.Session.Log True ' Send a unix command. The output of the command will ' be captured to the logfile. ' crt.Screen.Send "date" & vbCr ' Wait again for my login prompt or 5 seconds ' crt.Screen.WaitForString "linux$", 5 ' Turn off synchronous mode crt.Screen.Synchronous = false ' Stop logging and disconnect. ' crt.Session.Log False crt.Session.Disconnect End Sub
From novice to tech pro — start learning today.