#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    4
    Rep Power
    0

    Capturing Command Output using ReadString() Method - VBScript


    Hi All;

    i am trying to capture some commands ouput using the ReadString() method of the Screen object in the CRT but it always returns an empty string. not sure why, here is my code :

    dim row, Output, Lastrow, IntArr, i

    row = "ge-7/0/0,ge-7/1/0"
    IntArr = Split(row , ",")

    Lastrow = "RouterHostname>"

    for i = LBound(IntArr) to UBound(IntArr)

    crt.Screen.WaitForString ">"


    crt.Screen.Send ("show interfaces " & IntArr(i) & " extensive | no-more" & VbCr)
    crt.Screen.WaitForString vbcr
    Output = crt.Screen.ReadString(Lastrow)

    Msgbox Ouptut

    next

    --------------
    i dont get an error or anything, its just the Msgbox shows nothing, just an empty msgbox with no output displayed, any idea why ?

    your help is appreciated.
    Last edited by mizo1510; December 22nd, 2013 at 08:49 PM. Reason: Fixing Typos

IMN logo majestic logo threadwatch logo seochat tools logo