10 October 2011

Copy the Contents of a Text File without Opening the File

Suppose you have a text file in txt format and you want to copy the text inside it and use it in another document or place. What would be the order? First, open the file with Notepad, Select All and copy the whole contents and paste it into another text file or document. I’ll show you a trick that you can copy text and contents of a txt file without opening it and use it elsewhere. Follow these steps:

1. If you use Window XP, you must first download the CLIP.EXE file from the Microsoft site. Here is the download link

If you are wondering what is clip.exe file, then you should know it is a free DOS utility from Microsoft and it redirects output of command line tools to the Windows clipboard and the text output can then be pasted into other programs.
After downloading the exe file, double click it to run. If you use Windows Vista or 7, then you don’t need to download this file.   

2. Now open to Start>Run>regedit and go to

If you are not able to find txtfile, then first go to

and from the right pan see what is the name of the file type key, but it is usually txtfile. In Windows XP, expand this path:

Right click on the shell and select New>Key and name the new key copycontents.

3. Click on copycontents (the new key that you have made) to select it. In the right pane, double click on Default and in Value data section enter Copy Contents to Clipboard and select OK.

4. Again right click on copycontents and select New>Key and name the new key command.

5. Select command, and in the right window double click on Default and enter the following command for Value data

Select OK and exit from the Registry editor. It’s all done. 
After that whenever you right click on a text file, you have the option Copy to Clipboard. You can just select this option and the contents of the txt file will be copied to clipboard without the need of opening the actual txt file. If you want to go back to the Windows default, just delete the keys that you made in Registry.