To save the output of a command on the Windows clipboard, add a pipe* (|) operator to your command followed by the clip
command.
dir | clip
- copy the listing of current folder contents to the clipboard.
tree | clip
- copy a recursive directory structure to the clipboard.
pwd | clip
- copy the present working directory to the clipboard.
type notes.md | clip
- place content of notes.md to the clipboard.
driverquery | clip
- copy a listing of installed drivers to the clipboard.
sc query | clip
- copy a list of services and their status to the clipboard.
* This is a redirection operator which reads the output from one command and writes it to the input of another command. Also known as a pipe.
Redirects command output from the command line to the Windows clipboard. You can then paste this text output into other programs. Technet: Clip.
Syntax:
<Command> | clip
clip < <Filename>