Quickly Send Text From The Windows Command Line To The Clipboard

Quickly Send Text From The Windows Command Line To The Clipboard
To sign up for our daily newsletter covering the latest news, hacks and reviews, head HERE. For a running feed of all our stories, follow us on Twitter HERE. Or you can bookmark the Lifehacker Australia homepage to visit whenever you need a fix.

Grabbing information from the Windows command line could be easier, especially if all you know of is “Mark” and “Copy” in the windows’ context menu. Fortunately, there’s a great shortcut you can use, courtesy of the handy pipe (“|”) argument, that can speed up the process of securing the text your command-line programs spit out.

We’ve previously shown the old trick of capturing a command’s output using the “>” plus a filename, but this goes one step further by placing it directly on the clipboard, ready for a Ctrl+V. Amit Agarwal over at Digital Inspiration shows us that by substituting the > [filename] with | clip, you can have a command-line program redirect its content in this fashion.

Unfortunately, if you want to copy a typed-out command with arguments intact, you’ll still need to use the old “Mark / Copy” method. If anyone has a shortcut for this (without the use of third-party programs), let us know!

How to Copy the Command Output to Windows Clipboard [Digital Inspiration]


  • A hacky way of copying your command with arguments could be to write it out with an echo at the beginning.

    For example:

    echo command with arguments | clip

  • Wondering how many years this has been around. Oh, and just to let you know how well Microsoft communicates internally, I used to work for them. In Redmond. In the Windows division.

Show more comments

Comments are closed.

Log in to comment on this story!