For example, I can copy a file to the clipboard like this:
clip < file.txt
(Now the contents of file.txt
is in the clipboard.)
How can I do the opposite:
???? > file.txt
So that the contents of the clipboard will be in file.txt
?
For example, I can copy a file to the clipboard like this:
clip < file.txt
(Now the contents of file.txt
is in the clipboard.)
How can I do the opposite:
???? > file.txt
So that the contents of the clipboard will be in file.txt
?
Here is the CLIP program by Dave Navarro, as referred to in the answer by @foxidrive. It is mentioned in an article here: copying-from-clipboard-to-xywrite
A link to the download, along with many other resources is on this page: http://www.lexitec.fi/xywrite/utility.html
Here is a direct link to the download: "DOWNLOAD Clip.exe Copy from and to the clipboard by Dave Navarro, Jr."
If you accept to use
PowerShell
(and notcmd
) the you can use Get-Clipboard exactly as you was looking for.The adventage of this method is that you have nothing to install.
Note: In place of
clip
you can use Set-Clipboard that has more options.Note 2: If you really want to run it from
cmd
, you can callpowershell
as in the following examplepowershell -command "Get-Clipboard | sort | Set-Clipboard"
.You can use the paste.exe software in order to paste text just like you are describing.
http://www.c3scripts.com/tutorials/msdos/paste.html
With it you can do:
to paste the contents of the windows clipboard into the input of the specified command prompt
or
to paste the clipboard contents to the specified file.
I have a pair of utilities (from before the Clip command was part of windows) available on this page:
http://www.clipboardextender.com/general-clipboard-use/command-window-output-to-clipboard-in-vista
There are two utilities in there, Clip2DOS and DOS2Clip. You want Clip2DOS:
Clip2DOS Copyright 2006 Thornsoft Development Dumps clipboard text (1024 bytes) to stdout.
Usage: Clip2Dos.exe > out.txt Result: text is in the file. Limits: 1024 bytes. License: Free, as in Free Beer! http://www.thornsoft.com/dist/techsupport/dos2clip.zip
DELPHI SOURCE INCLUDED!
And hey, here it is (Clip2DOS.dpr) :
I know I'm really late to answer this, but you could write:
So the content of the clipboard will be the content of file.txt
There are third party clip commands that work bidirectionally.
Here's one: