There may be times when you want to quickly copy the contents of a text file in Windows to paste into another file. There is a way to do this simply by right-clicking on the text file containing the text you want to copy and selecting an option from the context menu.
To do this, you must edit the registry. We recommend that you backup the registry before making changes to it. Refer to the following posts for help in backing up the registry.
- How to backup specific keys in the registry
- How to backup and restore the Windows Registry
- Backup the Windows Registry with RegBak
To add the context menu option for copying text from a text file in Windows 7, enter “regedit” (without the quotes) in the Search programs and files box on the Start menu. Once regedit.exe has been found, press Enter or click the link to open the Registry Editor.
If you are running Windows XP, select Run from the Start menu.
On the Run dialog box, enter “regedit” (without the quotes) in the Open edit box and click OK.
In Windows 7, if the User Account Control dialog box displays, click Yes to continue.
NOTE: You may not see this dialog box, depending on your User Account Control settings. See our post, Windows 7 – How to configure UAC (User Account Control), for more information.
In the Registry Editor, navigate to the following key.
HKEY_CLASSES_ROOT\txtfile\shell
NOTE: The key in the middle of the path above is txtfile, not textfile. Both keys exist.
Right-click on the shell key and select New | Key from the popup menu.
A new key is added under the shell key with the text of the key selected. Type Copy Contents as the name for the new key.
Right-click on the Copy Contents key and select New | Key again from the popup menu.
Name this new key Command, make sure it’s selected, and then double-click on the (Default) subkey in the right pane.
Enter the following command into the Value data edit box.
CMD /C CLIP < “%1”
NOTE: Insert one space after CMD, /C, CLIP, and <.
Click OK.
The command you entered displays in the Data column for the (Default) subkey under the Command key.
To close the Registry Editor, select Exit from the File menu.
We created a sample file into which we will pasted the contents of another text file.
Here is the text to be copied into the first file.
To copy the contents of a file, in Windows Explorer, right-click on the file containing the text to be copied, and select Copy Contents from the popup menu.
Open the file into which you want to paste the text, and place the cursor where you want the text to be pasted. Use the program’s Paste command to paste the text.
In this example, we pasted the text from the second file at the end of the first file.
The Copy Contents option on the context menu can be useful if you take a lot of notes in Notepad, or other text editor, and need to copy the text into other programs for use. [via door2windows]
No comments:
Post a Comment