{"id":386,"date":"2008-07-25T15:05:34","date_gmt":"2008-07-25T09:35:34","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=386"},"modified":"2021-05-24T16:32:01","modified_gmt":"2021-05-24T11:02:01","slug":"copy-text-file-contents-to-clipboard-using-context-menu","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/copy-text-file-contents-to-clipboard-using-context-menu\/","title":{"rendered":"Copy Text file Contents to Clipboard via Right-Click Menu"},"content":{"rendered":"<p><em>To copy the contents of a text-based file, you open the file in an editor such as Notepad, use Select All and then copy the contents to the clipboard. How about accomplishing it using a command in the right-click menu?<\/em><!--more--><\/p>\n<h2>Add &#8220;Copy to Clipboard&#8221; to the Context Menu<\/h2>\n<ol>\n<li>Start the Registry Editor (<code>regedit.exe<\/code>)<\/li>\n<li>Go to the following branch:\n<pre>HKEY_CLASSES_ROOT\\SystemFileAssociations\\text\\shell<\/pre>\n<\/li>\n<li>Create a subkey named &#8220;<code>Clipboard<\/code>&#8220;<\/li>\n<li>Double-click <code>(default)<\/code> and set &#8220;<code>Copy to Clipboard<\/code>&#8221; as its data.<\/li>\n<li>Under &#8220;Clipboard&#8221;, create another subkey named &#8220;<code>command<\/code>&#8220;<\/li>\n<li>With the &#8220;<code>command<\/code>&#8221; key selected, double-click <code>(default)<\/code>\n<pre>HKEY_CLASSES_ROOT\\SystemFileAssociations\\text\\shell\\Clipboard\\command<\/pre>\n<\/li>\n<li>Set the <code>(default)<\/code> value data to:\n<pre>cmd.exe \/c type \"%1\" | clip.exe<\/pre>\n<\/li>\n<li>Exit the Registry Editor.<\/li>\n<\/ol>\n<div class=\"qt\">\n<h4>Registry File<\/h4>\n<p>To automate the above setting, use this .reg file.\u00a0Using Notepad, you can create a <a href=\"https:\/\/www.winhelponline.com\/blog\/how-to-use-reg-files-registration-entries-windows\/\">.reg file<\/a> with the following contents.<\/p>\n<pre>Windows Registry Editor Version 5.00\r\n\r\n[HKEY_CLASSES_ROOT\\SystemFileAssociations\\text\\shell\\clipboard]\r\n@=\"Copy to Clipboard\"\r\n\r\n[HKEY_CLASSES_ROOT\\SystemFileAssociations\\text\\shell\\clipboard\\command]\r\n@=\"cmd.exe \/c type \\\"%1\\\" | clip.exe\"<\/pre>\n<p>Double-click the registry file to apply the settings to the registry.<\/p>\n<\/div>\n<p>The &#8220;Copy to Clipboard<b>&#8220;<\/b> option appears for most of the text-based files (i.e., file types whose PerceivedType registry value is set to &#8220;<code>text<\/code>&#8220;) listed below:<\/p>\n<pre>.asm, .asmx, .aspx, .c, .cdxml, .cpp, .css, .csv, .cxx, .def, .diz, .h, .hpp, .hta, .htm, .html, .hxx, .inc, .ini, .java, .nvr, .php3, .pl, .plg, .ps1xml, .pssc, .sed, .shtml, .sql, .text, .tsv, .txt, .xml, .xsl<\/pre>\n<p>Now, right-click on a text file and choose <b>Copy to Clipboard<\/b>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/copyclip.png\" width=\"295\" height=\"104\" \/><\/p>\n<p>This copies the text file contents to the clipboard. To verify that, you may open Notepad or any other text editor and press Ctrl +V to paste the contents from the clipboard.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To copy the contents of a text-based file, you open the file in an editor such as Notepad, use Select All and then copy the contents to the clipboard. How about accomplishing it using a command in the right-click menu?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[7],"tags":[114,441],"class_list":["post-386","post","type-post","status-publish","format-standard","hentry","category-windows","tag-context-menu","tag-registry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":275,"url":"https:\/\/www.winhelponline.com\/blog\/add-copy-as-path-right-click-menu-in-xp\/","url_meta":{"origin":386,"position":0},"title":"How to Add &#8220;Copy as Path&#8221; to Right Click Menu in Windows XP","author":"Ramesh","date":"May 10, 2008","format":false,"excerpt":"Windows Vista and higher already include the useful Copy as Path option in the context menu, which helps you quickly copy the complete path of the selected file(s) or folder(s) to the Clipboard. Here is how to add \"Copy of Path\" feature in Windows XP. There are two methods discussed,\u2026","rel":"","context":"In &quot;Windows XP&quot;","block_context":{"text":"Windows XP","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-xp\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/copypath.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":4395,"url":"https:\/\/www.winhelponline.com\/blog\/copy-command-prompt-output-clipboard-save-file\/","url_meta":{"origin":386,"position":1},"title":"How to Copy Command Prompt Output Text to Clipboard or File","author":"Ramesh","date":"October 23, 2016","format":false,"excerpt":"Windows Command-line tools are great for troubleshooting, as well as automation. But, if you're stumped when a tech support guy on the phone asks you to run a built-in console command and copy the output displayed for diagnosing a problem, these Command Prompt basics will come in handy. This post\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"Command Prompt window","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/command-prompt-header.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/command-prompt-header.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/command-prompt-header.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":9532,"url":"https:\/\/www.winhelponline.com\/blog\/how-to-get-file-hash-via-right-click-menu-windows\/","url_meta":{"origin":386,"position":2},"title":"Get File Hash Checksum (MD5, SHA-256) via Right-click Menu","author":"Ramesh","date":"May 26, 2019","format":false,"excerpt":"Hashing means taking an input string of any length and giving out an output of a fixed length. Using the cryptographic hashing algorithm -- e.g., MD5, SHA-256, SHA-384, you can verify if two files are identical or not. The checksum is a hash value used for performing data integrity checks\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"get file hash right-click menu 7-zip","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/05\/7zip-get-file-hash-crc-sha-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/05\/7zip-get-file-hash-crc-sha-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/05\/7zip-get-file-hash-crc-sha-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/05\/7zip-get-file-hash-crc-sha-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":26750,"url":"https:\/\/www.winhelponline.com\/blog\/copy-file-details-version-product-context-menu\/","url_meta":{"origin":386,"position":3},"title":"Copy Detailed File Info to Clipboard via Right-Click Menu","author":"Ramesh","date":"June 7, 2022","format":false,"excerpt":"The Details tab in the Properties sheet shows the file version, product name, copyright, and other details. However, Windows doesn't let you copy the information to the clipboard. In this article let's see how to copy the file info to the clipboard using PowerShell. You can also incorporate the command\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"copy file information, version, product via powershell","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/06\/copy-file-info-context-4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/06\/copy-file-info-context-4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/06\/copy-file-info-context-4.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":4261,"url":"https:\/\/www.winhelponline.com\/blog\/print-directory-contents-using-chrome-firefox\/","url_meta":{"origin":386,"position":4},"title":"How to Print Directory Contents Using Different Methods","author":"Ramesh","date":"October 4, 2016","format":false,"excerpt":"You can copy folder contents by selecting all items in a folder, pressing Shift key and clicking the Copy as Path command in the right-click menu. Then open Notepad or any other text editor and paste the contents from the clipboard. But if you need to print the directory list\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"get directory listing - sysexporter","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/dir-list-sysexporter.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/dir-list-sysexporter.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/dir-list-sysexporter.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/dir-list-sysexporter.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3774,"url":"https:\/\/www.winhelponline.com\/blog\/copy-as-path-always-show-right-click-windows-10\/","url_meta":{"origin":386,"position":5},"title":"Show &#8220;Copy as Path&#8221; Always in Right-Click Menu Without Shift Key","author":"Ramesh","date":"December 28, 2016","format":false,"excerpt":"This post tells you how to always show the Copy Path option in the right-click menu by default in Windows 10, without needing to press Shift\u00a0every time. The much useful \"Copy as Path\" built-in context menu exists in all versions of Windows. It's an extended command which means you need\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"copy-as-path-always-show-windows-10","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/copy-as-path-always-2.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=386"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/386\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}