Windows Command Line Pipe To Clipboard

A quick post to cover a nice feature which people may not be aware of – the ability to pipe output from the Windows command line directly into the clipboard. It’s as simple as it sounds, we use the normal pipe function and then use the clip keyword. As an example let us run the tasklist¬†command and pipe the output of this command to the clipboard.

C:\>tasklist | clip

Pipe to clipboard example.png

Opening Notepad and pasting my clipboard contents results in the tasklist command output being written. This is really handy when you have a large command output or want to manipulate it in another tool.

Pipe to clipboard output

PowerShell is of course the way we should be doing things these days and it has the same functionality. That being said I still work on legacy systems which don’t have PowerShell and for the ones that do, half the time I open a shell it is the classic cmd.exe so this is still handy.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.