How to send command output to the Windows clipboard?

 You might be familiar with the notion of piping command output to “more” (| more). Doing so allows the output to be advanced one line at a time. A similar facility is provided by “clip,” an external program that takes any input and writes to the clipboard. So, simply pipe the output of your command to “clip” (| clip). For example, to send the output of a directory list to the clipboard, use

C:\>dir | clip

What is Windows Clipboard?

The Clipboard is a temporary storage area for information that you have copied or moved from one place and plan to use somewhere else. You can select text or graphics and then use the Cut or Copy commands to move your selection to the Clipboard, where it will be stored until you use the Paste command to insert it elsewhere. For example, you might want to copy a section of text from a website, and then paste that text into an e‑mail message. The Clipboard is available in most Windows programs.

In some versions of the Microsoft Windows operating system, the contents of the clipboard can be viewed at any time by using the Clipboard Viewer (Clipbook Viewer in Windows XP and 2000) application (clipbrd.exe). It can be run by pressing Windows key + r and typing clipbrd.exe. Alternatively, the program can be found at %windir%\system32\clipbrd.exe on such versions of Windows. In older versions of Windows the common practice was to open a copy of the “Notepad” or “Wordpad” editor, and paste into that. Often these operations are available from the “Edit” pull down menu and they may be available via a context menu, usually accessible by context-clicking in the window or dialog entry that is to be cut from or pasted into.

The standard Windows key bindings are:

  • Ctrl+C to copy data onto the clipboard
  • Ctrl+X to cut data to the clipboard
  • Ctrl+V to paste data from the clipboard

Alternative key bindings derived from the IBM Common User Access are:

  • Ctrl+Ins is copy
  • ⇧ Shift+Del is cut
  • ⇧ Shift+Ins is paste

The advantage of the alternative keys is that the fingers can stay close to the arrow and selection keys when one is editing a large body of text.

The Clipbook Viewer was removed entirely in Windows Vista.