The Windows command line prompt can be handy at times, and sometimes even the only option to execute a specific command on the operating system. You sometimes may need to copy the output of a command to the Windows Clipboard, for instance to use the output in another application.
Most users that I know handle this either by sending the output to a file with the > filename.ext command or by frantically trying to figure out a way to select and copy the output content in the command prompt window directly. Side note: The latter option got a lot better with the release of Windows 10.
Both methods are not really straightforward and need more time than the process should take in first place. Thankfully though there is a way to copy command prompt outputs directly to the Windows Clipboard, it is only lesser known.
Open the command prompt as usual. You can open it with standard rights or elevated rights by right-clicking on the icon in the start menu and selecting to run it as an administrator. Another option for that is to hold down the Shift-key and the Ctrl-key before selecting the Command Prompt link in the start menu.
Once there you can copy any output to the clipboard by appending | clip at the end of the command. A basic example is the dir command which outputs all folders and files of the current directory level directly in the command prompt. Please note that you won't see the output anymore on the screen as it is redirected to the clipboard when you use the | clip command.
The directory command is only a basic example to demonstrate the effect of the | clip command. You can obviously use it for complex commands and outputs as well. Whenever you use the clip command everything that is part of the output is copied to the Windows clipboard.
Did you know about the clip output command? If not, how did you copy the command prompt output until now?
Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.
We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.
If you like our content, and would like to help, please consider making a contribution:
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.