title: Using URI Scheme to Launch Program in NotePad++
body: <p>I'm writing an html document with links that, when the user clicks on them, should open a program with an argument.</p>
  
  <p>As an example to test this process out I've attempted to created a URI scheme that should launch notepad++.exe with an argument of a simple text file I've written</p>
  
  <p>Running straight from PowerShell looks like this, and successfully opens my text file</p>
  
  <pre><code>PS C:\&gt; &amp; 'C:\Program Files\Notepad++\notepad++.exe' 'C:\TestingDocument.txt'
  </code></pre>
  
  <p>I followed the instructions at <a href="https://msdn.microsoft.com/library/aa767914(v=vs.85).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/library/aa767914(v=vs.85).aspx</a>
  for creating a URI (I've called mine "NOTEPAD++"). And wrote an html file like the following to test this out:</p>
  
  <pre><code>&lt;html&gt; &lt;body&gt; &lt;a href="NOTEPAD++:C:\\TestingDocument.txt" &gt;Test&lt;/p&gt; &lt;/body&gt; &lt;/html&gt;
  </code></pre>
  
  <p>However when I click on the "Test" link in the web browser, notepad++ gets launched, but does not also open my text file...</p>
  
  <p>I'm guessing maybe my syntax for <code>NOTEPAD++:C:\\TestingDocument.txt</code> isn't right for passing in an argument?? Any help on this would be greatly appreciated.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>added registry key <code>Computer\HKEY_CLASSES_ROOT\NOTEPADPLUSPLUS</code> with:</p>
  
  <ul>
  <li><code>(Default)</code> of <code>URL:NOTEPADPLUSPLUS Protocol</code></li>
  <li><code>URL Protocol</code> of empty string</li>
  <li><code>DefaultIcon</code> with <code>(Default)</code> of <code>"C:\Program Files\Notepad++\notepad++.exe"</code></li>
  <li><code>shell</code> -> <code>open</code> -> <code>command</code> with <code>(Default)</code> of <code>"C:\Program Files\Notepad++\notepad++.exe" "%1"</code></li>
  </ul>