To copy all text in TXT files, we usually need to open documents, select content, and press the Ctrl + C hotkey. However, it would be more convenient if Windows 11’s context menu included an option that copies TXT files to the clipboard. Then users could copy text files simply by right-clicking them and selecting a copy context menu option.
Of course, Windows 11’s context menu doesn’t include such an option. However, that doesn’t mean it can’t have one. This is how you can add a Copy Content to clipboard option for text (TXT) document files to the context menu in Windows 11.
How to Set Up a Copy to Clipboard Context Menu Option for Text Files
To add a new Copy Content context menu option for text files, a bit of registry editing is required. You’ll need to add a couple of new keys to the registry and modify their string values. It is a relatively straightforward registry tweak, but you can back up the registry or set up a restore point beforehand if preferred. Just follow these steps exactly as outlined to set up a Copy Content option.
- Launch the Run accessory (press its Windows + R key combination).
- Type regedit in Run, and click the OK button.
- Navigate to the HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell key within the Registry Editor. You can copy and paste that path into Registry Editor’s location bar by selecting the text and pressing Ctrl + C and Ctrl + V.
- Right-click shell and select New to open a submenu.
-
Select the Key option on the submenu.
- Enter CopytoClip within the text box for the new key.
- Click CopytoClip with your right mouse button and select New > Key.
-
Type command to be the subkey’s title.
- Select the CopytoClip key, and double-click its (Default) string.
- Type Copy Content within the Edit String window, and click OK to exit.
- Select the command subkey, and double-click (Default) on the right of the window.
-
Enter cmd /c clip < "%1" into the Value data box.
- Select OK to exit the Edit String window.
Find a TXT text document within File Explorer. Right-click the TXT file to select Show more options. You should now see a Copy Content option on the classic menu. Select that option to copy the text file’s content to the clipboard.
To check if the text content has been copied, press the Windows + V key to bring up the Clipboard history tab shown directly below. There you can select multiple copied items to paste into documents. To paste a copied text file’s contents somewhere else, open a suitable app and press the Ctrl + V keyboard shortcut.
If you ever want to remove the Copy Content option, erase its CopytoClip key. You can do so by opening the registry at the HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\CopytoClip location. Right-click CopytoClip there to select a Delete option.
How to Set Up Copy to Clipboard Context Menu Options for Other File Formats
The Copy Content option above will only be available for Notepad’s TXT text file format. However, you can set up more Copy Content context menu options for other file formats by editing the registry much the same. You can set up copy options for registry script (REG), batch (BAT), Extensible Markup Language (XML), and JavaScript (JS) at these registry locations:
- REG: HKEY_CLASSES_ROOT\regfile\shell
- BAT: HKEY_CLASSES_ROOT\batfile\shell
- XML: HKEY_CLASSES_ROOT\xmlfile\shell
- JS: HKEY_CLASSES_ROOT\JSFile\shell
To set up copy options for those file formats, follow the registry-editing steps above for their listed shell key locations. Add CopytoClip and command keys to them with the same (Default) string values specified for the TXT format. Then you’ll be able to select a Copy Content option on the context menu for REG, BAT, XML, and JS files.
Copy Text Files Quicker From the Context Menu
The Copy Content option for text files will come in handy whenever you need to copy all the contents from TXT documents into other software. When that context menu option is available, you won’t need to open up TXT files, select all their text, and press the Ctrl + C hotkey to copy. So, that’s a convenient shortcut you can add to the context menus in Windows 11 and 10 by editing the registry as covered above.