views:

118

answers:

2

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.

+1  A: 

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.

Joachim Sauer
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`
Mike Nelson
+1  A: 

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.

Richard Harrison
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
@caf: I like that idea - it's simple neat and does the job.
Richard Harrison
Very elegant idea.
mbac32768