Saturday, May 23, 2009

How to Copy/Paste Commands/Texts in Command Prompt in Windows

Here i will explain how to copy/paste the commands or text inside the command prompt in windows.



You might have used the Windows Command Prompt utility in Windows at least for some reason. It is really annoying to type all such long commands. If any where goes wrong we need to type that command from the beginning. I have been using command prompt for long time and was like this. You might search for some pc solution in the internet and might go to some sites and you find some commands which needs to be typed in the command prompt window and executed to solve that problem. This is really a tiring task especially when you don't have time to type all those commands one by one. How about copying those commands directly from a windows or browser where ever it be and pasting it directly on the command prompt window and vice-versa?



It is very easy to copy and paste the commands inside the command prompt window to/from the windows clipboard.




  • Copy/Paste Single line Commands : Single line commands can be easily copied/pasted using the mouse itself. To do this right click inside the command prompt window and select the “Mark” command. You can select the area you need to copy by dragging the cursor from beginning or from the end , and press [Ctrl]+[C] to copy the command to the windows clipboard. Now you can paste that command any where as you do with normal text.


  • How to copy/Paste Commands in Command Prompt in Windows

  • Copy/ Paste Long Commands (Longer Lists) : It is more wise to use the clip.exe program in order to copy long lists of commands in the command prompt. Clip.exe program is only available in Windows Vista and Windows 7. It is directly integrated and runs from the Command Prompt Windows. You can easily link the clip.exe program with the help of the ‘|’ (pipe symbol) with the required command from the command line window. The pipe symbol can be accessed by pressing ‘[Shift]+[\]’. For example, typing the command ‘dir | clip’ and pressing enter will copy a directory having or the given folder to windows clipboard. 


  • Copy the Entire Contents of a File Using Command Prompt : You can even transfer the contents of a text file ‘project.txt’ directly into the  windows clip board by giving the command ‘type project.txt | clip’. You can also the ‘<’ (Less than) sign for this same task. Typing the command ‘Clip<project.txt’ will copy the entire contents of the ‘project.txt’ file to the windows clipboard. 


  • Pasting Commands to Command Prompt : After you have copied the required command to the windows clipboard you can paste the command directly to the command prompt window. Just right click inside the Command Prompt Window and select “Paste” from the context menu that appears.





    Playing with long commands in Windows Command Prompt Program will not be a problem for you from now on.

Labels: , ,

2 Comments:

Anonymous Anonymous said...

In my environment pressing Ctrl-C eliminate marked command prompt and doesn't work on Paste. So after marking do this: right click on a top bar of command prompt window, select Edit and select Copy. Now you can Paste.

June 13, 2009 at 12:41 AM  
Blogger Amal said...

Thanks Friend for the good information.

June 13, 2009 at 6:58 AM  

Post a Comment

Its your Turn now. Post Your Opinions and Doubts here. All comments are moderated. I will respond to your comments shortly. So, Do check back :) And This is a Do Follow Blog.

Subscribe to Post Comments [Atom]

<< Home