{"id":1104,"date":"2014-07-21T14:14:56","date_gmt":"2014-07-21T14:14:56","guid":{"rendered":"http:\/\/scunster.co.uk\/?p=1104"},"modified":"2014-07-21T14:23:56","modified_gmt":"2014-07-21T14:23:56","slug":"send-text-to-windows-clipboard-from-a-batch-file","status":"publish","type":"post","link":"https:\/\/scunster.co.uk\/?p=1104","title":{"rendered":"Send text to Windows clipboard from a batch file"},"content":{"rendered":"<p>This is how to send text to Windows clipboard from within a batch file.<\/p>\n<p>This is particularly useful if you often end up typing or copying the same blocks of text regularly. Once you&#8217;ve created the bat files, save them on the desktop and then every time you click on one Windows clipboard will have your text ready to paste!<\/p>\n<p><strong>echo off | clip<\/strong> in the following examples just clears the clipboard of any existing text first, it isn&#8217;t really necessary but I&#8217;ve kept it in as if you have any issues writing your batch \/ echo lines, you will at least know that the clipboard will be empty.<\/p>\n<pre>echo off | clip\r\necho This text will now be ready to paste when you run this bat| clip<\/pre>\n<p>If you have several lines of text, then you&#8217;ll need to wrap then in brackets ()<\/p>\n<pre>echo off | clip\r\n(\r\necho This is line one\r\necho This is line two\r\necho this is line three\r\n)| clip<\/pre>\n<p>If you need blank lines and want to get rid of Windows newline after each line of text then do the following.<\/p>\n<pre>echo off | clip\r\n(\r\necho.|set \/P=This is the first text line.\r\necho.\r\necho.\r\necho.|set \/P This is the second text line.\r\necho.\r\necho.\r\necho.|set \/P This is the third text line\r\n)| clip<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is how to send text to Windows clipboard from within a batch file. This is particularly useful if you often end up typing or copying the same blocks of text regularly. Once you&#8217;ve created the bat files, save them on the desktop and then every time you click on one Windows clipboard will have [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[169,17,168],"tags":[197,196,195,35,199,198],"class_list":["post-1104","post","type-post","status-publish","format-standard","hentry","category-win-7-10-tips-tricks","category-windows","category-xp-tips-tricks","tag-bat","tag-clip","tag-clipboard","tag-copy","tag-echo","tag-text"],"_links":{"self":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1104"}],"version-history":[{"count":5,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1104\/revisions"}],"predecessor-version":[{"id":1109,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1104\/revisions\/1109"}],"wp:attachment":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}