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
  #1  
Old 10-20-2020, 12:30 PM
samky2005 samky2005 is offline
Registered User
 
Join Date: Feb 2010
Posts: 12
save in the text file

Hello

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?

Code:
  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
  objFile.Close

Thank you
Samky2005

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

Tags
readstring , save to a file


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 12:26 AM.