Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Very Handy Utility

Very Handy Utility

Scheduled Pinned Locked Moved Visual Basic
csharpdotnettoolshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    William Bartholomew
    wrote on last edited by
    #1

    Not sure about you guys but I often need to paste the output of console apps into emails, documents, and the like so what I normally do is: dir /s > test.txt Then open up "test.txt" and then copy and paste the contents to wherever I need it and then delete "test.txt" now this is a pain and I thought there has to be a better way. So I wrote a utility in VB.Net to solve the problem. I would have written this as an article but the .NET Framework has made this so simple the article would be too short :) 1. Create a new console application 2. Add a Reference to System.Windows.Forms 3. Paste this code into the Main function Dim strInput As String strInput = Console.In.ReadToEnd() Windows.Forms.Clipboard.SetDataObject(strInput, True) 4. Compile and put the resulting .exe in your path Now all you need to do is: dir /s | YourProgramName.exe Then go into your email, document, etc. and paste... the program has captured the console output and put it into the clipboard. Hope you guys find this helpful.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups