Command prompt is the soul of Windows operating system. If you're a programmer, you may know it very well that how much important it is. There are tons of commands which can do almost anything with your computer. Sometimes you may need to copy the text from cmd window but there is no direct option to do this as like we can do in case of copying text from other editors.
In other words, you can't select, copy, cut and paste anything directly in command prompt. Then how to do it? Fortunately, Windows provide another methods which can troubleshoot this problem. In this short tutorial, I will guide you how to do that. There are two different methods you can try. Let's start with first one.
Command prompt provides manual edit options using which you can select, copy and paste any text easily. Normally, we right-click on text to perform these task but in case of command prompt, these features are hidden. So here I will tell you how to find and use them. Follow these step by step instructions.
This method is quite different from first one. Here we will use clip command. Before moving further, let me tell you about clip. It simply redirects the output of command line tool to the Windows clipboard which can be later pasted in other programs also.
One more important thing is that, it copies single command output only. You can't use it to copy complete text of cmd as like you can do in first method. The basic syntax of clip command is - "Your command here | CLIP"
For example, SET /? | CLIP
This will copy all output of "Set /?" code. Actually when you'll add "/?" symbol after any command then it will display the help information. In the same way, above code will automatically copy all help information of set command. Few other examples are as follows -
Additional Tip: There is another amazing use if clip command. You can also use it to copy text from any files. For example, if you've a txt file then clip command can copy all of its text. The basic syntax is -
CLIP < C:\Users\Username\Desktop\README.TXT
Above code will copy all text from readme.txt file to windows clipboard. Note that, this readme file is saved on desktop. Simply change this file location as per your own requirements and again try it yourself. Finally if you've any doubts, feel free to ask me in below comment box. I am always here to help you. Which method you've used? Stay connected for more interesting tutorials.
In other words, you can't select, copy, cut and paste anything directly in command prompt. Then how to do it? Fortunately, Windows provide another methods which can troubleshoot this problem. In this short tutorial, I will guide you how to do that. There are two different methods you can try. Let's start with first one.
1. Using CMD Edit Options
Command prompt provides manual edit options using which you can select, copy and paste any text easily. Normally, we right-click on text to perform these task but in case of command prompt, these features are hidden. So here I will tell you how to find and use them. Follow these step by step instructions.
- First of all, open cmd.exe from start menu.
- Now when you want to copy the text, right-click on program title.
- A hidden menu will open. Here click on "Edit" option and then click "Mark" button.
- Now select the text that you want to copy as like you select other text in editors. Alternatively, you can use "Select All" button. This will change the background color of cmd from black to white color which will highlight the selected area.
- After this, go back to the edit option and click "Copy" button.
- Finally open your favorite editor, say I choose Notepad and paste all text inside it.
2. Using Clip Command
This method is quite different from first one. Here we will use clip command. Before moving further, let me tell you about clip. It simply redirects the output of command line tool to the Windows clipboard which can be later pasted in other programs also.
One more important thing is that, it copies single command output only. You can't use it to copy complete text of cmd as like you can do in first method. The basic syntax of clip command is - "Your command here | CLIP"
For example, SET /? | CLIP
This will copy all output of "Set /?" code. Actually when you'll add "/?" symbol after any command then it will display the help information. In the same way, above code will automatically copy all help information of set command. Few other examples are as follows -
- DIR | CLIP - Display a list of all files and sub-directories of a particular directory.
- HELP | CLIP - This will copy all cmd help information.
- TREE C:\ | CLIP - Display the graphical structure of your C drive folders.
- ECHO Hello | CLIP - This will simply copy "Hello" word.
Additional Tip: There is another amazing use if clip command. You can also use it to copy text from any files. For example, if you've a txt file then clip command can copy all of its text. The basic syntax is -
CLIP < C:\Users\Username\Desktop\README.TXT
Above code will copy all text from readme.txt file to windows clipboard. Note that, this readme file is saved on desktop. Simply change this file location as per your own requirements and again try it yourself. Finally if you've any doubts, feel free to ask me in below comment box. I am always here to help you. Which method you've used? Stay connected for more interesting tutorials.
Leave A Comment