Copy and Paste in Command Prompt Windows
Although console programs don't have the display windows and menus of ordinary Windows programs, you can still use the mouse to copy and paste text to and from Command Prompt windows.
To copy text to the Clipboard, you have to extract a rectangular block of text-you can't select text line-by-line as you're used to. Position the mouse at the upper-left corner of the block of text you want, drag it down to the bottom-right corner, and then press Enter.While you're selecting text, the word Select appears in the window's title. Command Prompt window looks White when selecting text.
You can also select text using the window's System menu. Click the upper-left corner of the window or press Alt+space, and then select Edit, Mark. Use the arrow keys to move the cursor to the upper-left corner of the desired area, and then hold the Shift key down while moving the cursor to the lower-right corner. Press Enter to copy the selected text.
You can paste text into a Command Prompt window using the same menu, except to paste, select Edit, Paste.To paste to a Command Prompt window, however, the program running in the window has to be expecting input.
Tip: The keyboard shortcut for Paste is worth memorizing: Alt+space, E, P.
By the way, "cut" isn't available-after something is typed in a Command Prompt window, it's typed and can't be removed.
If you need to run a mouse-aware MS-DOS program in a Command Prompt window, you want to disable the Select feature so that mouse movements are sent to the program rather than being interpreted by the console program window.To disable the use of the mouse for copying text, select the window's Properties dialog box and uncheck Quick Edit.
In this tutorial:
- The CMD Command-Line
- CMD Versus COMMAND
- Running CMD
- Opening a Command Prompt Window with Administrator Privileges
- CMD Options
- Disabling Command Extensions
- Command-Line Processing
- Console Program Input and Output
- Using the Console Window
- I/O Redirection and Pipes
- Copy and Paste in Command Prompt Windows
- Command Editing and the History List
- Name Completion
- Enabling Directory Name Completion
- Multiple Commands on One Line
- Grouping Commands with Parentheses
- Arguments, Commas, and Quotes
- Escaping Special Characters
- Configuring the CMD Program
- The Search Path
- Changing the Path
- Predefined and Virtual Environment Variables
- Setting Default Environment Variables
- Built-in Commands
- Extended Commands
- Listing Files with the Dir Command
- Paginating Long Listings
- Printing Directory Listings
- Sorting Listings
- Locating Alternate File Streams
- Setting Variables with the Set Command
- Conditional Processing with the if Command
- Scanning for Files with the for Command
- Using the for Command's Variable
- Processing Directories
- Numerical for Loop
- Getting More Information