Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • December 09, 2016, 01:31:29 PM
  • Proudly celebrating 10 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 1574 times)

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,141
  • Slartibartfarst
    • View Profile
    • 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:42 AM by IainB »

Winkie

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 82
    • 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:29 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: 679
  • 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:39 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: 4,475
    • 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:09 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,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: How to Copy the Command Output to Windows Clipboard - and to CHS
« Reply #4 on: August 11, 2013, 11:11:59 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: http://www.donationc....msg138125#msg138125