rating: 0+x

Download script

@rem = '--*-Perl-*--
@perl -x -S %0 %* && exit /b && '
#!/usr/bin/perl -w
#line 3
=head1 NAME
clip.cmd - put/get Windows system clipboard.
=head1 USAGE
   clip < text.txt
   type text.txt | clip
put text to windows clipboard
   clip > file.bmp
save bitmap from clipboard to file   
Perl module Win32::Clipboard required.
The script must be wrapped as windows cmd to proper handle input/output
=head1 AUTHOR
dMitry <>
use Win32::Clipboard;
my $clip=Win32::Clipboard();
if (-t STDIN ) {    # Nothing on input, so print clipboard
    binmode STDOUT    if $clip->IsBitmap();
    local $,="\n"    if $clip->IsFiles();
    print $clip->Get();
} else {        # STDIN redirected, so put it in clipboard
    local $/;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License