SearcH MY Website

Google

Sunday, March 9, 2008

Copy Command Line Output to Windows Clipboard Directly


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.



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.

No comments: