Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting

Thread Tools Rate Thread Display Modes
Old 01-17-2013, 05:10 PM
timchampion timchampion is offline
Registered User
Join Date: Oct 2010
Posts: 23
Access to Windows clipboard

Does anyone know if it's possible for a SecureCRT / Python script to access the Windows clipboard? I'm thinking of writing a 'safe-paste' script for Cisco devices.... A user would:

a) copy their config script
b) switch to their CRT session
c) run the script which would start sending the contents of the Windows clipboard line by line.
d) Should the Cisco CLI throw an error, i.e. '% Invalid input detected at '^' marker.' the script would stop sending the remaining config and display a messagebox.

I've found lots of examples of going from screen to clipboard but not the reverse direction.


Reply With Quote
Old 01-18-2013, 07:42 AM
rtb rtb is offline
VanDyke Technical Support
Join Date: Aug 2008
Posts: 4,306
Hi Tim,

This should be possible. The SecureCRT Text method in the Clipboard object can be used to either get or set the clipboard contents.

Chapter 8 in the scripting manual discusses various uses of the Clipboard object. It is geared to VBScript, but the SecureCRT methods and objects and concepts used should be translatable to Python. You can find the scripting manual at the following location:
Does this information help you write your script?

VanDyke Software
Technical Support
Reply With Quote

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 03:30 PM.