Tips & Tricks, Tutorials, Hacking, Troubleshooting,

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.

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.

Opening the Registry Editor in Windows 7

If you are running Windows XP, select Run from the Start menu.

Selecting Run from the Start menu in Windows XP

On the Run dialog box, enter “regedit” (without the quotes) in the Open edit box and click OK.

Entering

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.

User Account Control dialog box

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.

Adding a new key under the shell key

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.

Renaming the new key to Copy Contents

Right-click on the Copy Contents key and select New | Key again from the popup menu.

Adding a new key under the Copy Contents key

Name this new key Command, make sure it’s selected, and then double-click on the (Default) subkey in the right pane.

Double-clicking the (Default) subkey for the Command key

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.

Entering Value data for the Command key

The command you entered displays in the Data column for the (Default) subkey under the Command key.

Value entered for Command key

To close the Registry Editor, select Exit from the File menu.

Closing the Registry Editor

We created a sample file into which we will pasted the contents of another text file.

File into which text will be pasted

Here is the text to be copied into the first file.

File with text to be copied

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.

Copying contents of a text file

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.

Pasting text into file

In this example, we pasted the text from the second file at the end of the first file.

Text pasted

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