Professional Geek
RSS icon Email icon Bullet (black)
  • Command Prompt and the Clipboard

    Posted on September 13th, 2016 Andy Parkes 4 comments

    Filed under “I didn’t know you could do that”.

    Something I discovered recently I thought it was one of those things I’d just missed over the years but after a conversation I had in the office I thought it might be worth sharing here too.

    Normally when working with the command prompt if you want to copy some output you have to switch from the keyboard to the mouse.

    Command

    Which is fine, but if you’re working with the keyboard (because you know, command prompt!) switching between that and the mouse can break your flow, well it does for me.

    Turns out you can redirect output straight to the clipboard by piping to clip.exe

    e.g

    Ping google.com | clip

    The output goes to the clipboard ready for pasting elsewhere.

    This is also particularly useful if the output is long and topamax fills the visible area of the screen.

    This is the output from “DriverQuery”, you’d have hard time copying all of that with the mouse

    Command 2

    Useful thing to know!

    This works in PowerShell too and it’s where I use it most.

    The following two tabs change content below.
    Andy Parkes is Technical Director at Coventry based IT support company IBIT Solutions. He is also Microsoft Partner Area Lead for 2012-2013 and coordinates AMITPRO which is a peer group for IT Professionals in the Midlands area. He also isn't a fan of describing himself in the third person.

    Latest posts by Andy Parkes (see all)

     

    4 Responses to “Command Prompt and the Clipboard”

    1. Blimey! I didn’t know that either – makes doing things like “tree” a lot more useful.

    2. definitely!

    3. And I’ve used it twice already!

    4. Brilliant! Glad this was of some help

    Leave a Reply