Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 10-20-2020, 12:30 PM
samky2005 samky2005 is offline
Registered User
Join Date: Feb 2010
Posts: 12
save in the text file


I was able to use ReadString() to capture the output of "show running-config" command and save it into the file using objFile.WriteLine.
However the very first line in the text file included the command.
Is there way not to include the command in the text file?

  Dim objTab, szCommand

  Set objTab = crt.GetScriptTab
  szCommand = "show cur"
  objTab.Screen.Send szCommand & chr(13)
  objTab.Screen.WaitForString vbCr 
  Dim strResult, objFile
  strResult = objTab.Screen.ReadString ("return",3)
  Set objFile = g_fso.OpenTextFile("c:\temp\config_sample.txt", ForWriting, True)
  objFile.WriteLine strResult

Thank you

Last edited by cboyack; 10-20-2020 at 12:50 PM. Reason: Please use [CODE] and [/CODE] tags to denote code strings

readstring , save to a file

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 04:40 PM.