MS-DOS Commands :: paste
The paste command pastes text from the Windows Clipboard to any command's input. You can thus take some text from a Windows application and use it as input into some command.
Note: The paste command is not a standard part of
MS-DOS. See paste.exe Availability below.
Tip: paste | sort | clip takes the Windows Clipboard, sorts it, and copies it back to the Windows Clipboard. Requires: clip
Joel 'Jaykul' Bennett (HuddledMasses.org) is a C# programmer who wrote his own custom paste program (see paste.cs C# source code).
WARNING: This custom paste program is intended to be used only with ASCII text files. Also, it contains a bug that causes an extra blank line (two byte sequence: x0D x0A) to be appended to the end of the pasted output.
Follow these steps to install the paste.exe command program:
Download paste.zip and unzip it to get paste.exe
Put paste.exe in %windir%\system32 directory (typically C:\Windows\system32) or in any other directory that is in your path.
Note: If you want to see the source code and create the .exe yourself (using the Microsoft Visual C# compiler of .NET Framework 3.5), see: clip-paste.zip
paste | command
Paste the contents of the Windows Clipboard into the input of the specified command command.
paste | command | clip
Paste the contents of the Windows Clipboard into the input of the specified command command then copy its output to the Windows Clipboard.
For example, paste | sort | clip sorts the contents of the Windows Clipboard. Requires: clip
paste > filename
Pastes the contents of the Windows Clipboard into the specified filename file.
paste | sort > filename
Sorts the contents of the Windows Clipboard and saves sorted output to the specified filename file.
- Copy command output to Windows clipboard.