In Windows Vista as well as Windows Server 2003 you can use the command line parameter clip to to pipe or output the result to the clipboard. (This was available in Windows NT and Windows 2000 Resource Kit)
Example: dir | clip
No need to mark and copy from the command window. Even file contents can be copied to the clipboard. It also works with PowerShell.
clip /? | clip
gives the result below that I just pasted in:
Redirects output of command line tools to the Windows clipboard.
This text output can then be pasted into other programs.
/? Displays this help message.
DIR | CLIP Places a copy of the current directory
listing into the Windows clipboard.
CLIP < README.TXT Places a copy of the text from readme.txt
on to the Windows clipboard.
I like it and want it on my Windows XP. No problem. Just copy clip.exe (found in system32) from a machine with Windows Server 2003 (does not work with the one from Vista) and place it in the system32 folder on the Windows XP machine.