{"id":10359,"date":"2026-04-22T00:44:33","date_gmt":"2026-04-22T00:44:33","guid":{"rendered":"https:\/\/www.hexacorn.com\/blog\/?p=10359"},"modified":"2026-04-22T00:44:33","modified_gmt":"2026-04-22T00:44:33","slug":"some-unintelligent-fun-with-ms-notepad-protocol","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2026\/04\/22\/some-unintelligent-fun-with-ms-notepad-protocol\/","title":{"rendered":"Some unintelligent fun with ms-notepad protocol"},"content":{"rendered":"\n<p>In my previous <a href=\"https:\/\/www.hexacorn.com\/blog\/2026\/04\/18\/a-few-more-protocol-handlers-part-2\/\" data-type=\"post\" data-id=\"10356\">post <\/a>I have provided a list of &#8216;new&#8217; protocols I noticed in the latest Windows 11 build.<\/p>\n\n\n\n<p>One that immediately caught my attention was &#8220;ms-notepad:\/\/&#8221;. You can use it to launch Notepad via &#8220;ms-notepad:\/\/&lt;filename>&#8221; links and it also accepts command line switches.<\/p>\n\n\n\n<p>So&#8230;<\/p>\n\n\n\n<p>One could launch:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ms-notepad:\/\/foobar.txt<\/pre>\n\n\n\n<p>and that would make Notepad attempt to open one of these:<\/p>\n\n\n\n<ul>\n<li>C:\\Users\\&lt;user>\\ms-notepad:\\foobar.txt\\<\/li>\n\n\n\n<li>C:\\Users\\&lt;user>\\ms-notepad:\\foobar.txt.txt<\/li>\n<\/ul>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ms-notepad:\/\/..\\..\\..\\foobar.txt<\/pre>\n\n\n\n<p>to open:<\/p>\n\n\n\n<ul>\n<li>C:\\foobar.txt<\/li>\n\n\n\n<li>C:\\foobar.txt.txt<\/li>\n<\/ul>\n\n\n\n<p>If you embed a link pointing to the above <em>foobar.txt<\/em> file in a HTML file and open in f.ex. Microsoft Edge, and then click the link, you will see Notepad trying to open the following files:<\/p>\n\n\n\n<ul>\n<li>C:\\Users\\&lt;user>\\ms-notepad:..%5C..%5C..%5Cfoobar.txt\\<\/li>\n\n\n\n<li>C:\\Users\\&lt;user>\\ms-notepad:..%5C..%5C..%5Cfoobar.txt.txt<\/li>\n<\/ul>\n\n\n\n<p>It looks like the protocol handler is not doing very well with this unexpected input.<\/p>\n\n\n\n<p>Additionally, new <em>Notepad.exe<\/em> accepts a <em>\/TESTING:>argument><\/em> command line argument. I don&#8217;t fully understand how the program processes this <em>argument<\/em>, but I noticed it has to be provided in a Base64 form.<\/p>\n\n\n\n<p>So:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">file:\/\/..\\..\\..\\test\\foobar.txt   <\/pre>\n\n\n\n<p>can be converted to a Base64 blob:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ZmlsZTovLy4uXC4uXC4uXHRlc3RcZm9vYmFyLnR4dCAgICA=<\/pre>\n\n\n\n<p>One can then launch Notepad with a TESTING argument from a command line or via a protocol handler:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">notepad \/TESTING:ZmlsZTovLy4uXC4uXC4uXHRlc3RcZm9vYmFyLnR4dCAgICA=\nms-notepad:\/\/ \/TESTING:ZmlsZTovLy4uXC4uXC4uXHRlc3RcZm9vYmFyLnR4dCAgICA=<\/pre>\n\n\n\n<p>In both cases the Notepad will try to open:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">C:\\test\\foobar.txt<\/pre>\n\n\n\n<p>And while nothing substantial comes out of this quick &#8216;research&#8217;, I find it pretty interesting that so many new URL-like protocols are still being introduced in new Windows builds.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous post I have provided a list of &#8216;new&#8217; protocols I noticed in the latest Windows 11 build. One that immediately caught my attention was &#8220;ms-notepad:\/\/&#8221;. You can use it to launch Notepad via &#8220;ms-notepad:\/\/&lt;filename>&#8221; links and it &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2026\/04\/22\/some-unintelligent-fun-with-ms-notepad-protocol\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[53],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10359"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=10359"}],"version-history":[{"count":1,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10359\/revisions"}],"predecessor-version":[{"id":10360,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10359\/revisions\/10360"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=10359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=10359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=10359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}