How can I get script output to copy to windows clipboard?

I find that I run scripts and copy their output to emails or to some other documents. Is there a way so that I can make the copy step to the buffer part of the script itself? Most of my scripts are Perl or bat files, and I work on Windows.

Thanks.

+5
source share
3 answers

Here is a utility called clip.exe that you can use. Just include the output of your script or any other command in the clip.exe file (first, put it in your path somewhere. If you don’t have the usual place for these types of utilities, you can dump it into the directory that you usually run your scripts, or I know what people use c:\Windows\system32as a last resort ...):

somescript.bat | clip

Then insert.

+7
source

In Perl, install and use Win32 :: Clipboard module

+2
source

, , - :

somescript.bat > output.txt
0

All Articles