topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday March 28, 2024, 8:07 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

Last post Author Topic: Redirect screen output to clipboard  (Read 34159 times)

blackcat

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 62
    • View Profile
    • Donate to Member
Redirect screen output to clipboard
« on: November 13, 2008, 07:00 AM »
usually we redirect output on command prompt screen to file eg dir /b /s >c:\filelist.txt but is there way to redirect those output directly to clipboard?

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #1 on: November 13, 2008, 07:49 AM »
There's an utility that is used for AutoHotkey that puts what it reads to the clipboard. So, if you redirect the output to it, you should be good to go ;)
Get it here.

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #2 on: November 13, 2008, 09:55 AM »
I wrote a small command line app in C++ I use all the time to do this.. If you are interested I could throw it up on my website..
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #3 on: November 13, 2008, 02:34 PM »
I use cb often

dir /b /s |cb

There is a 512k limit. But this is no problem since i use it for small issues only and would redirect large amounts to file.

I would like to test ChalkTraumas as well  :P

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #4 on: November 13, 2008, 02:39 PM »
Ok... I'll get something up on the site and post here when I do, since there is an interest.
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #5 on: November 13, 2008, 10:44 PM »
Ok.. here it is:

ClipCopy

Pretty simple to use:

* 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..

I compiled it with VS 2005 SP1 so you probably need the runtime if you don't already have it, if you do need it you can get it HERE

~enjoy  :Thmbsup:
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #6 on: November 14, 2008, 10:03 AM »
Thanks ChalkTrauma this works fantastic  :Thmbsup:
I was able to redirect and paste to editor up to 75.000 lines (on an simple test) .... cb give me 1.000 - 3.000 lines only (512k limit)
(very limited comparison because i compare output lines only instead of real char-count, but that's enough for me to see how it works)

Thank you very much for sharing  :-*  :Thmbsup:

BTW would'nt it be a good idea to distribute your exe with your-last-post-content as ClipCopy.txt ?

blackcat

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 62
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #7 on: November 14, 2008, 07:47 PM »
Chalk, thanks for sharing  :up:

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #8 on: November 14, 2008, 09:23 PM »
No problem at all, I've got a bunch of these little command line apps lying around that do really specific things, glad someone else got some use out of one of them  :D
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

blackcat

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 62
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #9 on: April 08, 2009, 08:32 AM »
ChalkTrauma, how about showing on screen at the same time as redirecting to a file?

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #10 on: April 08, 2009, 08:42 AM »
I would use something like tee to do this:

http://unxutils.sourceforge.net/


so. something like the following command line:

dir /b | clipcopy -e | tee dirlist.txt

 :Thmbsup:
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #11 on: September 05, 2009, 05:58 PM »
i use this quite often but can't remember where i got this from, until today. :) this is a very good tool, thanks ChalkTrauma! :Thmbsup:

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #12 on: September 05, 2009, 08:43 PM »
I'm glad you find it useful, thanks for the reply  :Thmbsup:
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #13 on: September 05, 2009, 09:00 PM »
so what other command line gems have you written? please do share with us.. :)

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #14 on: September 06, 2009, 12:06 PM »
I guess at last count I have over 50 of these things I wrote to solve this problem or that, they are in various states of completeness. Some have wacky command line params that do odd things if you combine them, that I have never fixed or documented, and some continue to evolve to help me do things in my 'day job'..

I guess I really should run through them and see whats there.. Maybe this is the little push I need to package some of these up for general use..
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #15 on: September 06, 2009, 06:01 PM »
I guess I really should run through them and see whats there.. Maybe this is the little push I need to package some of these up for general use..

i'm glad that i was able to provide the motivation.. ;D

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #16 on: September 08, 2009, 02:03 PM »
I've started work on this and I'm currently cleaning up docs and code and putting together a web page..

I'm going to package it all up into one self-extracting archive with docs and put it up on my site. I'll get the stuff that is closer to being complete out first and the other stuff will come later..

I'll start a thread over in 'Other Programs' rather than hijack this one, when things are ready...
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #17 on: September 09, 2009, 10:47 PM »
thanks for taking the time to do this. your efforts are much appreciated. :)

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #18 on: September 09, 2009, 10:52 PM »
Well I'm about 4 apps in, and have found a few bugs along the way, I think I'll shoot for 10 and then release it and then start on the next batch..
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #19 on: September 09, 2009, 11:32 PM »
don't burn yourself out before this year's NANY 2010 event!

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #20 on: September 10, 2009, 10:17 AM »
me... burnout... never..  :D
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #21 on: October 28, 2009, 07:35 PM »
Ok guys and gals.. almost ready for a release, just tidying up a few loose ends.. I really don't like releasing anything 0.5f done if I don't absolutely have to, so getting this stuff ready took a while and I'm a few days away from having it all ready, but the page is up on my site if you want to have a look.

I'll be moving the rest of the conversation about these tools over to the Other Programs forum once the download is up there..

Again, thanks for the interest  :up:
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

Ehtyar

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,237
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #22 on: October 28, 2009, 08:08 PM »
I really don't like releasing anything 0.5f done
Epic nerd-humor creds there, I had to think for a second wtf you were talking about :Thmbsup:

Ehtyar.

ChalkTrauma

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 116
  • ::41554D::
    • View Profile
    • DreamCycle Studios
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #23 on: October 28, 2009, 09:16 PM »
w00t! +1 on the geek points  :D
'Behold! It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: Redirect screen output to clipboard
« Reply #24 on: October 28, 2009, 11:29 PM »
the page is up on my site if you want to have a look.

Fantastic work.  Thanks for sharing.