2008年11月5日星期三

pipe console program output to clipboard

I am making some demostration these days. I need run some console programs, get their output and put them into a nice slice as example. The trivial way is to redirect the output to a plain text file then open it, Ctrl+A to select all and copy, switch to PowerPoint, paste, which is exactly what I am doing.  Some days past, I feel I can't stand it anymore. A simple idea just jumped out of my mind, why not make a small tool the can read data from pipe and copy to clipboard? So I can do my jod like this(assume the program is called cmd2cb.exe):

dir|cmd2cb
type readme.txt|cmd2cb

thus, all output of dir command are read by cmd2cb and copy to clipboard. Then I simply switch to PowerPoint and Ctrl+V. Everything's done. Small tool, but cool!

When I share this tool to my colleages, it turns out that I am not the only one needs it.
So I decides to put it to my box. If you need, just download here. cmd2cb.exe (9k)
Chinese user can download from namipan(纳米盘): cmd2cb.exe (9k)

*This file can only be used in windows, console and after the pipe symbol and no warranty.
*If you're using Vista, you can use Clip.exe shipped with Vista.

没有评论: