Clipcmd
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   
 
=head1 DEPENDENCIES
 
Perl module Win32::Clipboard required.
 
The script must be wrapped as windows cmd to proper handle input/output
redirection.
 
=head1 AUTHOR
 
dMitry <mitry@mitry.spb.ru>
 
=cut
 
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 $/;
    $clip->Set(<STDIN>);
}
 
__END__
:endofperl
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License