Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy text from a Windows CMD window to clipboard

Does anyone know if it's possible to copy text from a Windows' command prompt or console window like the output of a command, console application or batch file?

like image 541
user1508893 Avatar asked Jul 18 '12 14:07

user1508893


People also ask

How do I copy from Command Prompt to clipboard?

By appending “| clip” to the end of your command the output will be copied to your clipboard. You can then paste it into notepad or any other text editor just like anything else on the clipboard.

How do I enable copy and paste in cmd?

Go to “Properties -> Options” and check the field that says “Enable Ctrl key shortcuts.” It is, however, not required to check the field for “Use Ctrl+Shift+C/V as Copy/Paste,” especially in Windows 11, as you still copy-paste without it, as it supports universal keyboard shortcuts.

How do I select all text in cmd?

Select all of the text in your document or on your screen by holding down the "Ctrl" key and pressing the letter "A". 18 Tech Support Reps Are Online! Microsoft Answers Today: 65. Remember the "Select All" shortcut ("Ctrl+A") by associating the letter "A" with the word "All".


1 Answers

Another option, if you know ahead of time that you want the results of a command to be placed on the clipboard, is to pipe your output to the CLIP utility.

Here are a two simple examples

echo Hello world!|clip  dir|clip 
like image 136
dbenham Avatar answered Sep 23 '22 12:09

dbenham