Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In Windows you can change file associations from the command line using the <code>assoc</code> and <code>ftype</code> commands (see the <a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true" rel="nofollow">Windows Command-line Reference</a>).</p> <p>You can see what file type is currently associated with .py files using the <code>assoc</code> command:</p> <pre><code>&gt; assoc .py .py=Python.File </code></pre> <p>With that information you can then check to see what program is currently associated with the <code>Python.File</code> file type using the <code>ftype</code> command:</p> <pre><code>&gt; ftype Python.File Python.File="C:\Python2.6\python.exe" "%1" %* </code></pre> <p>You can also use <code>ftype</code> to change the associated program:</p> <pre><code>&gt; ftype Python.File="C:\Python2.7\python.exe" "%1" %* Python.File="C:\Python2.7\python.exe" "%1" %* </code></pre> <p>Associations set this way are persistent because they're stored in the Windows Registry. That means you will need to set or restore it to what you want before terminating the <code>cmd.exe</code> session. I'd suggest using one or more batch files for this purpose.</p> <p><code>cmd.exe</code> itself accepts a <code>/k</code> parameter, which you could use to have it execute a batch file at start up that sets up the file association you want initially. You could then also provide a custom <code>quit.bat</code> that would restore it before exiting the <code>cmd</code> session.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload