Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-13-2015, 01:19 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,099
Example: Store Command Results in the Clipboard

Update: jdev: 05-19-2017, 2:57pm : Support for a new command line argument has been implemented (/WriteToFile:PathToOutputFile) to allow for captured data to be written to a file as well.

This example script is mentioned in a demonstration as part of the Advanced Copy & Paste video on our You Tube channel.

The script does the following:
  1. Determines the current shell prompt on the remote system
  2. Enters a loop, continuously waiting for the shell prompt to appear (again).
  3. When the shell prompt appears, the text output captured between appearances of the prompt is automatically copied into the clipboard.

    To stop the script, simply choose "Cancel" from SecureCRT's main "Script" pull-down menu.

Script arguments have been implemented to allow for changing of specific behaviors.
For example, you could map a button (using SecureCRT's Button Bar) to run the script, and in the Arguments field you could specify one of the supported arguments to get slightly different behavior as described below:
Code:
' Supported Arguments (change script's behavior to match your preferences):
'    /CaptureStartingEOL:True|False     If specified as True, the leading
'                                       line ending character sequence is
'                                       captured and included in the clipboard
'                                       as part of the output of the command.
'                                       If not specified, or set to False, the
'                                       leading EOL character sequence is
'                                       OMITTED from the output that is stored
'                                       in the clipboard.
'
'    /CaptureTrailingEOL:True|False     If specified as True, the trailing
'                                       EOL character sequence is captured and
'                                       included in the clipboard as part of the
'                                       output of the command.
'                                       If not specified, or set to False, the
'                                       trailing EOL character sequence is
'                                       OMITTED from the output that is stored
'                                       in the clipboard.
'                                       
'    /CaptureOnlyCmdOutput: True|False  If specified as True (default), only the
'                                       command output will be copied to the
'                                       Clipboard. If specified as False, both
'                                       the command issued and the results are
'                                       copied to the Clipboard.
'
'      /WriteToFile:"PathToOutputFile"  If this option is present, the script
'                                       will write the results to the file
'                                       specified in the PathToOutputFile
'                                       value.
Attached Files
File Type: txt StoreCommandResultsInTheClipboard.vbs.txt (11.9 KB, 2203 views)
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support

Last edited by jdev; 05-19-2017 at 03:05 PM.
Closed Thread

Tags
example script

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:26 PM.