topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 6:57 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: How to Copy the Command Output to Windows Clipboard - and to CHS  (Read 4265 times)

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,540
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Apologies for any duplication if this has already been posted in DCF.

Nifty tip from Labnol.org: How to Copy the Command Output to Windows Clipboard

Just use the Pipe (|) and "clip"

Example:
Typing dir | clip at the Command prompt puts the directory list into the Clipboard, or directly into CHS (Clipboard Help & Spell) if you are using it.
« Last Edit: August 11, 2013, 04:31 AM by IainB »

Winkie

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 93
    • View Profile
    • Donate to Member
Re: How to Copy the Command Output to Windows Clipboard - and to CHS
« Reply #1 on: August 11, 2013, 07:09 AM »

Note that the clip command isn't available on Windows XP and earlier versions op Windows by default. See here for more information and instructions how to obtain the functionality if  your system does not have it.

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: How to Copy the Command Output to Windows Clipboard - and to CHS
« Reply #2 on: August 11, 2013, 03:40 PM »
There is another utility called cb.exe that does the same thing, though I'm not sure what source I got it from.  But you can also use winclip.exe to push stdin to the clipboard, or pull the clipboard contents into a file (or just to the cmd window if you want to see what's in there).
vi vi vi - editor of the beast

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Re: How to Copy the Command Output to Windows Clipboard - and to CHS
« Reply #3 on: August 11, 2013, 10:01 PM »
There is another utility called cb.exe that does the same thing, though I'm not sure what source I got it from.

You can download cb.exe from the AutoHotkey FAQ: Download link

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: How to Copy the Command Output to Windows Clipboard - and to CHS
« Reply #4 on: August 11, 2013, 11:11 PM »
i use ClipCopy which was written by a fellow DoCo member, ChalkTrauma.

Usage
* This will copy the output from dir /b to clipboard
dir /b | clipcopy

* This will do the same but echo out to stdout at the same time ( like tee )
dir /b | clipcopy -e

* This will dump the text contents of the clipboard to stdout
clipcopy -g

* So you can dump the clipboard contents to a file like this
clipcopy -g > clipboard.txt

* You can also put strings directly on the clipboard like this
clipcopy this is going to the clipboard

Well, that is about all it does, you can type clipcopy -h for usage..


DL: http://www.dreamcycl...wnload/?ClipCopy.exe
Source: https://www.donation....msg138125#msg138125