title: FTYPE/ASSOC priority and adding to OpenWithList from the command line
body: <p>(Not sure if this belongs on superusers, but it seems there is a cmd.exe tag here, so here goes...)</p>
  
  <p>As background, I'm working on a Firefox add-on (This question does not require knowledge of Firefox, btw, as Firefox add-ons can call the command line.) The add-on aims to build different kinds of shortcuts to cmd.exe (especially for the sake of my project <a href="https://github.com/brettz9/webappfind" rel="nofollow">https://github.com/brettz9/webappfind</a> which allows files to be opened directly from the desktop into web apps).</p>
  
  <p>Anyways, I'd like to give users the option to associate these shortcuts:</p>
  
  <ol>
  <li>As the default handler for specific file extensions or file types.</li>
  <li>To show up within the Open With list of applications (even if the user opts not to make the apps as default handlers)</li>
  </ol>
  
  <p>As far as the default handling, I have found the <code>ftype</code> and <code>assoc</code> (and <code>associate</code>) commands, but I have read that user selections will override their behavior. Is there some way to ensure that I can get priority from the command line in associating file extensions to types and specific executables (until the user changes it again), or if it is not possible, then at least through C++ or the like?</p>
  
  <p>As far as the Open With list:</p>
  
  <pre><code> HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\&lt;file extension&gt;\OpenWithList
  </code></pre>
  
  <p>...in my testing (with an exe), this command:</p>
  
  <pre><code>reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.svg\OpenWithList /v d /d D:\wamp\www\webappfind\cplusplus\WebAppFinder-view-mode-Firefox.exe
  </code></pre>
  
  <p>...did cause the exe file to show up in:</p>
  
  <pre><code>reg query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.svg\OpenWithList
  </code></pre>
  
  <p>...but it did not show up when I subsequently right-clicked a file with the ".svg" extension. </p>
  
  <p>I would really appreciate any help with these two points.</p>