Page 1 of 1

Portable console utility to get clipboard text to STDOUT or file

Posted: Wed Feb 06, 2019 10:21 am
by RJ_STN
Hi everyone!

I am searching a small console utlity that can prints out clipboard text data (types: CF_Text, CF_Unicodetext, CF_oemtext) rith to STDOUT.
Neither powerful NirCmd, nor InsideClipboard can do that.
Only close mthod is command 'nircmd clipboard saveclp "c:\temp\1.clp"' but it saves to file ALL clipboard data (and I can't properly read it from batch script).

May be, someone knows such kind of software?
Something like:
'clipboard.exe get cf_text' - in stdout prints text
'clipboard.exe get cf_text > file.txt' - prints data to file file.txt

Re: Portable console utility to get clipboard text to STDOUT or file

Posted: Wed Feb 06, 2019 10:59 am
by billon
@RJ_STN:

winclip

Re: Portable console utility to get clipboard text to STDOUT or file

Posted: Wed Feb 06, 2019 1:02 pm
by Midas
Yori (viewtopic.php?t=24254) is an alternative CLI that includes a CLIP command to manipulate the Windows clipboard from the console. YMMV.

Code: Select all

Clip 0.98

Manipulate clipboard state including copy and paste.

CLIP [-license] [-e|-h|-p|-t] [filename]

   -e             Empty clipboard
   -h             Copy to the clipboard in HTML format
   -p             Paste the clipboard
   -t             Retain only plain text in the clipboard

Re: Portable console utility to get clipboard text to STDOUT or file

Posted: Wed Feb 06, 2019 1:35 pm
by lintalist
Clip is standard (Windows Vista+) but someone made a Paste https://www.c3scripts.com/tutorials/msdos/paste.html

Re: Portable console utility to get clipboard text to STDOUT or file

Posted: Wed Feb 06, 2019 2:32 pm
by Midas
Yep, unlike Yori's, Windows Clip can't paste...

Code: Select all

CLIP

Description:
    Redirects output of command line tools to the Windows clipboard.
    This text output can then be pasted into other programs.

Parameter List:
    /?                  Displays this help message.

Examples:
    DIR | CLIP          Places a copy of the current directory
                        listing into the Windows clipboard.

    CLIP < README.TXT   Places a copy of the text from readme.txt
                        on to the Windows clipboard.

Re: Portable console utility to get clipboard text to STDOUT or file

Posted: Tue Feb 12, 2019 4:11 am
by RJ_STN
billon wrote: Wed Feb 06, 2019 10:59 am @RJ_STN:

winclip
Thanks! Winclip really works and do what I need.