3

We have a script right now which our Windows users run on a Linux host by way of putty. From time to time the script produces a string that the user must copy and paste into a Windows application.

Without running a full-blown X display server on the Windows box, I'd like to modify the script so that the string is populated in the Windows user's copy/paste buffer automatically so that it's more convenient for the user and so that we reduce the error rate (the workflow is clumsy enough, we'd like to make it a little less so).

Here's what I don't consider solutions:

  1. Running a full blown X display manager on the Windows side just for this (if there exists a nearly invisible utility that enables just this one feature that's a different story)
  2. Make the user stop running Windows
  3. Rewrite any other applications

I have full control over the Windows user's environment (can set up whatever putty settings I need to) as well as the Linux host and every node in the network between the two.

3 Answers 3

2

If I had to do this I'd probably grab the sources to putty and modify it to suit.

Failing that I don't think you'll be able to easily do this; except by writing a small script on the Linux box that will open a socket to the a small windows deamon and send the text across to be put into the Windows clipboard.

Sign up to request clarification or add additional context in comments.

2 Comments

The most elegant way to implement as a PuTTY enhancement would probably be to add a "ANSI Printer output goes to Clipboard" option. The Linux scripts would then just use VT102 printer escapes to delimit the text that it wants to go to clipboard.
@caf: I like that idea - it's simple neat and does the job.
1

If the remote script doesn't need full terminal support but only does simple stdin/stdout operation, then you might be able to use plink to provide a simple text-only interface which can probably be scripted more easily than a full PuTTY window.

1 Comment

If using plink you may be able to put the output into the paste buffer with clip.exe (you may have to download and install it). plink login.example.com -l fred echo hello, world | clip
0

http://ericmason.net/2010/04/putty-ssh-windows-clipboard-integration/

This guy's script patches putty to just what was suggested above. I think it would be more elegant to have just a printer driver you can install in windows to get text to the clipboard, rather than patching putty, but this works!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.