How do you copy and paste within a Windows command prompt?
I know how to open a command prompt in Microsoft Windows, but the normal methods for cutting and copying and pasting -- like Ctrl-C and Ctrl-V -- don't seem to work inside a command prompt window. How can I do copying and pasting with a command prompt?
It's possible to copy and paste within a Microsoft Windows command prompt, and to copy and paste text to/from other programs, but the commands and keyboard keys to do so are different from most other Windows programs.
Pressing Ctrl-C and Ctrl-V do not work, and selecting text within a command prompt to copy, requires a few more steps.
To paste text within a command prompt that has been copied from another program, is the easiest. Simply copy the text from the other program, then right-click inside the command prompt window and pick "Paste":
To copy text from a command prompt is a bit more awkward. As you know from using Microsoft Word and many other programs, when you select text on the screen, the selection runs from the first word you selected, to the last word:
Inside a command prompt, on the other hand, the "selected" text doesn't run from the first selected word, in straight lines from left to right across the command prompt window, to the last selected word. Instead, you can only select text within a command prompt that lies inside a perfect rectangle!
For example, suppose you were trying to type "ipconfig" inside a command prompt, and you accidentally typed "ioconfig" and got this error message:
You want to copy this error message and e-mail it to your friend to ask them what went wrong. To select text within the command prompt window, first right-click anywhere inside the command prompt and pick "Mark":
Then, to select text, you left-click inside the command prompt window, and drag the mouse pointer to create a rectangle outlining the text that you want to copy:
And then to actually copy the selected text, hit the Enter key. Observe that in this case, the selection really did only include the text inside the rectangle, rather than running to the end of the line, back to the beginning of the next line and so on. So if you paste the selected text into another program, it really will only paste the text that was included in the rectangle:
(It's a bit difficult to explain why text selection works this way in a command prompt, but it has to do with the history of the command prompt interface, which goes all the way back to DOS, the forerunner of Microsoft Windows from the 1980s. Essentially, the command prompt interface only "knows" that its output consists of a pattern of characters that are displayed in certain fixed positions on the screen, in a grid that happens to be exactly 80 characters wide and 45 lines high. These characters could be text, or graphics from a primitive computer game that displayed graphics by filling the screen with letters in a certain pattern -- the command prompt doesn't "know" that the characters consist of text, and that the user wants to select a block of text that runs to the end of the line, then starts at the beginning of the next line, and so on. Just realize that Microsoft didn't design the command prompt interface this way just to screw with you.)
So to copy the entire text of the error, you have to click and drag a rectangle around the entire text that you want to select:
and then hit Enter to copy the text to your clipboard. Then you can paste it in an e-mail message to your friend.
Bennett Haselton is a technology and political blogger who writes guest articles for AskDaveTaylor, but his real passion lies elsewhere, like telling people how to bypass 8e6 filtering software.
More Useful Windows PC Help Articles:
✔ What's the easiest way to speed up my Windows PC laptop?
My Dell Windows 7 laptop is starting to drive me crazy. It's so darn slow! I've had it a few years and I...✔ Can I force a Windows 7 OS system update?
Every so often Windows 7 pops up a window and tells me that there are updates. That's nice, but how can I force...✔ Fix Google Drive (Gdrive) no longer supported (out of date)?
I'm a big Google fan and have been using Google Drive for quite a while as a cloud storage device. It's a breeze,...✔ How do I open or unpack a RAR archive on my Windows PC?
I have some ".rar" files on my Windows 8 PC and am curious how to unpack them to see what's inside. From a...✔ How can I shrink my Windows 8 Desktop file icons?
I've figured out most things in the new Windows 8 interface, except I can't see how to easily reduce or shrink the file...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
I do have a comment, now that you mention it!
Check This Out Too...
Look for Answers
All Our Categories
Apple iPad Help
Articles and Reviews
Auctions and Online Shopping
Blogs and Blogging
Building Web Site Traffic
Business and Management
Computer and Internet Basics
d) None of the Above
Google Gmail Help
Google Plus Help
Industry News and Trade Shows
iPhone and Cell Phone Help
iPod, Sony PSP and MP3 Player Help
Kindle Fire Help
Mac OS X Help
Pay Per Click (PPC) Advertising
Search Engine Optimization (SEO)
Shell Script Programming
Tech Support Video Help
The Writing Business
Twitter, LinkedIn and Social Network Help
Unix and Linux Help
Video Game Tips and Help
Windows PC Help
Find Me on Google+
ADT on G+