JSI Tip 0178 - Command line cut & paste.

Jerold Schulman

June 18, 1997

1 Min Read
ITPro Today logo in a gray background | ITPro Today

CMD.exe supports command line cut and paste.

You can copy and paste text between MS-DOS and Windows NT. In the command prompt window, right-click anywhere on the title bar to see a menu, click Edit, and then click Mark. Select the text you want to copy and press ENTER to copy the text to the Clipboard or just right click again. You can then paste the text into your application.

Using the paste command, you can paste the Clipboard contents to the current command line. If you paste multiple lines of commands, they will all be executed in turn. Example:

dir c:boot.ini
attrib -r -s -h c:boot.ini
dir c:boot.ini
attrib +r +s +h c:boot.ini

Copy the above to the clipboard, open a cmd prompt, right click the title bar, click Edit, click Paste. The figure shows how each command was executed:

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like