SecureCRT: VBScript printing output to console
<p>I have written script to connect from my local machine to Jump server using secure crt. i was able to execute the script and capture the output into Msgbox, But unable to print it to console.</p>

<p>Below is the code which i have written.</p>

<pre><code>    #$language = "VBScript"
#$interface = "1.0"
Set objTab = crt.GetScriptTab
Set g_shell = CreateObject("WScript.Shell")

Public szData

crt.Sleep 6000

    objTab.Screen.IgnoreEscape = True
    objTab.Screen.Synchronous = True

    Dim szCommand, szPrompt, nRow, szLogFileName, nIndex

    Do
        bCursorMoved = objTab.Screen.WaitForCursor(1)
    Loop until bCursorMoved = False

    nRow = objTab.Screen.CurrentRow
    szPrompt = objTab.screen.Get(nRow, _
                                 0, _
                                 nRow, _
                                 objTab.Screen.CurrentColumn - 1)
    szPrompt = Trim(szPrompt)

crt.Screen.Synchronous = True

Dim pran

Sub Main

    strVal = crt.Arguments(0)

    crt.Screen.Send "pwd" &amp; chr(13)
    crt.Screen.WaitForString "[xyz@xlpv0002 ~]$"
    crt.Screen.Send "sh test.sh" &amp; chr(9) &amp; chr(13)

    **szData = CaptureOutputOfCommand("sh test.sh", "[xyz@xlpv0002 ~]")  &amp; vbCr**   
    'MsgBox(szData)
    pran = szData

    crt.Clipboard.Format = "CF_TEXT"
    crt.Clipboard.Text = pran

    crt.Dialog.MessageBox("Text is now in the clipboard: \n\n" + crt.Clipboard.Text)
    'MessageBox.Show(szData)

    If Not SendExpect("exit", "[xyz@xlpv0002 ~]") then exit sub

    g_shell.Run "%comspec% /c taskkill /IM SecureCRT.exe /F"

End Sub

'=======================================================================
Function CaptureOutputOfCommand(szCommand, szPrompt)
    if crt.Session.Connected &lt;&gt; True then
        CaptureOutputOfCommand = "[ERROR: Not Connected.]"
        exit function
    end if

    objTab.Screen.Send szCommand &amp; vbcr
    objTab.Screen.WaitForString vbcr
    CaptureOutputOfCommand = objTab.Screen.ReadString(szPrompt)

End Function
'======================================================================
Function SendExpect(szSend, szExpect)
    if objTab.Session.Connected &lt;&gt; True then exit function

    objTab.Screen.Send szSend &amp; vbcr
    objTab.Screen.WaitForString szExpect

    SendExpect = True
End Function
'========================================
</code></pre>

<p>I am capturing the script output into szData  variable. Is there a way to print the same in the console?</p>