This tutorial explains how to copy file content to clipboard using right-click menu. After going through this tutorial, you’ll be able to easily copy all the content (text content) of various files like TXT, HTML, CMD, BAT, CSV, XML, and more to the clipboard using the context menu (right-click menu). The best part is that you won’t need to open the files for copying content to clipboard. Yes, you heard it right and this tutorial will walk you through the simple steps to copy file content to the clipboard without actually opening the files.
In this tutorial, I will explain how to copy content to clipboard from these 10 different file types: TXT, HTML, XML, CMD, CSV, BAT, RTF, JS, REG, and INI files. Actually, this can be done with a simple registry hack where you have to manipulate the “Shell” key of any of these files from which you want to copy text content. This can make copying content from files lot easier and you don’t have to open the files and directly copy the content to clipboard from context menu.
How to Copy Content of a Text File to Clipboard Using Right-Click Menu:
Step 1: First, press “Windows Key + R” to launch the “Run” prompt and type “regedit” in the input field to open up the registry editor. After the registry editor opens up, simply go to the following key location:
"HKEY_CLASSES_ROOT\txtfile\shell"
Step 2: Now, right click on the “shell” and select New →Key to create a new key and give a name to the key as “copytoclip“. After that, simply click on it and you’ll see a key value named, “Default” on the right pane. Double-click on the key value and enter any name in the “Value Data” field such as Copy Content, Copy Content to Clipboard, etc. As an example, I will name the new key as “Copy Content to Clipboard“. Remember, whatever name you enter in value data will be visible on the right-click menu for copying content.
Step 3: When you are done naming the new key, simply right-click on it to create another new key and name it as “command“. For this key, you’ll also see a (Default) key value on the right. Simply double-click on it and enter the following code in the “Value Data” field.
cmd /c clip < "%1"
Step 4: After that, click “OK” and close the registry editor. The changes will be automatically applied and you can right click on any text file and see the “Copy Content to Clipboard” option in the context menu. Now, whenever you’ll click on this option, all the text content will be copied to the clipboard and you don’t even have to open the text file.
The process of copying content from all the other files using right-click menu is also similar to copying content from a text file as we have seen in the above section, but the “shell” key location will be different for each file.
How to Copy HTML File Content to Clipboard from Right-Click Menu:
When you open up the registry editor, you need to navigate to the following key location:
"HKEY_CLASSES_ROOT\ChromeHTML\shell"
After that, you need to create new keys and change the value data of key values in the similar way as explained for the text file above. Once you’re done, you’ll be able to copy all the text context from an HTML file from right-click menu.
How to Copy XML File Content to Clipboard using Context Menu:
For copying XML file content to clipboard using content menu, simply open up the registry editor and go to the following key location:
"HKEY_CLASSES_ROOT\xmlfile\shell"
After that, you can go ahead and create the required keys and change the value data, using the same process as above. When you do that, you can right-click on any XML file and copy content to the clipboard from the context menu.
How to Copy Context from INI File to Clipboard using Right-Click Menu:
First, open registry editor and browse the following shell key location:
"HKEY_CLASSES_ROOT\inifile\shell"
Then create both the keys and change their values to enable the option of copying file content to clipboard from right-click menu.
How to Copy CSV File Content to Clipboard using Context Menu:
To get started, you need to open registry editor and browse the below key location:
"HKEY_CLASSES_ROOT\Excel.CSV\shell"
Now, create the required keys and enter value data in the similar way as explained for text file above. When you do that, you will be able to copy text content from CSV files to clipboard right from context menu.
How to Copy Content from CMD File using Right-Click Menu:
After opening the registry editor, you need to find the following key location:
"HKEY_CLASSES_ROOT\cmdfile\shell"
Then you will have to create the keys and edit value data which are required for enabling the option of copying content to clipboard from right-click menu.
How to Copy BAT File Content from Context Menu to Clipboard:
First, launch the registry editor and then you need to go to the below shell key location:
"HKEY_CLASSES_ROOT\batfile\shell"
After that, right click on the shell key to start creating both the keys and change the value data. Then close the registry editor and you can start copying CMD file content to the clipboard with just a click from the context menu.
How to Copy RTF (Rich Text Format) File Content to Clipboard using Right-Click Menu:
To copy RTF file content to clipboard from context menu, you need to create the required keys and change value data in the following location of the registry editor.
"HKEY_CLASSES_ROOT\Word.RTF.8\shell"
How to Copy Content from JavaScript File to Clipboard using from Right-Click Menu:
To copy JavaScript file content to clipboard right from the context menu, you need to add the keys in the following shell key location:
"HKEY_CLASSES_ROOT\JSFile\shell"
After that, whenever you can right-click on any JS file you’ll see the option to copy file content to clipboard.
How to Copy Content from REG (Registration Entries) File to Clipboard from Context Menu:
If you would like to copy REG file content to clipboard from context menu, then you need to go to the following shell key location:
"HKEY_CLASSES_ROOT\regfile\shell"
After that, create the necessary key and enter their value after which you can right-click on any REG file and directly copy the file content to clipboard.
My Final Verdict:
If you’re looking for a way to copy file content to clipboard from the right-click menu and without even opening the files, then this tutorial can help you do that. In this tutorial, I have explained how to copy content from 10 different file types to clipboard right from the context menu. No Rocket Science is required, and you can achieve the same with simple registry hacks.
I hope you find this tutorial useful.