Digital Inspiration

about    faq    contact

Copy Command Line Output to Windows Clipboard Directly

dos-command-clipboard Windows XP offers no easy solution for copying the output of DOS commands to the clipboard.

You have to select Mark from the contextual menu, use the mouse to highlight text that has to be copied and then press Enter.

Some DOS veterans use the redirect operator (> or >>) that puts all the command line output to a text file which can be opened in Notepad. (Also read: "Most Useful Windows DOS Commands")

Since both the above methods involve way too many steps, we look at a simple alternative - use Clip - a free DOS utility from Microsoft that is included in Windows Server 2003 resource kit but works just fine for Windows XP or Vista.

Just copy this clip.exe [14 kb] file to your Windows folder and then use it with a PIPE (|) operator in your DOS commands. Here are some examples:

dir /h | clip - Copy the help manual for DIR command to the clipboard

tracert www.labnol.org | clip - Trace the path from your computer to another website - the output is automatically copied to the clipboard and not displayed on the screen.

netstat | clip - Check if your computer is connecting to websites without your knowledge.

The clip.exe utility can also be used to copy contents of text files to clipboard directly from the command line.

clip < C:\AUTOEXEC.bat - this will copy all the text from autoexec.bat to your Windows Clipboard.

dos-clipboard-command

Related: Store More Content in Your Windows Clipboard.

The clip.exe file comes only with the Windows 2003 or Windows Vista so I am not sure if they are distributing the original Windows file on petri.co.il or written something similar on their own.

Email This   Print Article   Save as PDF   Subscribe   Translate 

Published on March 5, 2008 under Software, Tips, Tricks, Tutorials
Tags: , , ,

Recommended Google Software:

You may also like to read ..

 · Useful Keyboard Shortcuts for the DOS Command Prompt in Windows
 · How to Uninstall Windows Vista SP1
 · Rename Multiple Files Efficiently Using Excel or Google Docs
 · Store More Items In Your Windows Clipboard with ClipX
 · Gifts for Geeks: Cushions Embroidered with DOS Directories

Reader Comments

#1 maheshexp 03.05.08

I guess ‘>’ & ‘>>’ will be handy in any shell

#2 Pankaj 03.06.08

Great tip,thanks

#3 anjan bacchu 03.06.08

hi there,

I accomplish the same using a perl script(which has win32 extensions).

good to know about the clip.exe : now I can ask colleagues to use this technique as well (earlier it was tough to ask them to install perl just for this utility)

BR,
~A

#4 benjamin 03.12.08

I use console instead of cmd. console supports the normal copy/paste

#5 Gord 03.20.08

Why does it seem that every time something is posted on a forum re. command line tips for Windows, some Linux user has to butt in with a comment about how their console is better than cmd in Windows? Really, it’s just annoying, and it’s irrelevant. But mostly it’s just a bore. Please stop it. Thanks.

#6 zcer 03.20.08

i think he meant console the windows cmd replacement. http://sourceforge.net/projects/console

Add a Comment

If you have a question that is not related to the above discussion, please post your question in the message board for quick answers. All comments are moderated.



 

Joing the Facebook Group

Visit Help Central

 

© 2008 Digital Inspiration - Technology, à la Carte | Mobile Edition | Videos | Terms

The articles are copyrighted to Amit Agarwal and can only be reproduced given the author's permission.

My Google  Netvibes  My Yahoo!  Windows Live  Bloglines  Newsgator  

Skip to top of the page ^^