what are the executable types on windows/cmd? and what are their priorities?

前端 未结 2 1199
深忆病人
深忆病人 2021-01-19 08:31

For example if there are multiple executable files on the path i.e., a.exe, a.bat and user types \'a\' (enter), which file will execute?

What other executable format

相关标签:
2条回答
  • 2021-01-19 09:19

    Windows looks at the PATHEXT environment variable to decide which file types are considered executable:

    > echo %PATHEXT%
    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    

    The first matching file on the path that has one of those extensions will be executed.

    You can use the assoc and ftype commands to find out how the file will be executed:

    > assoc .msc
    .msc=MSCFile
    
    > ftype MSCFile
    MSCFile=%SystemRoot%\system32\mmc.exe "%1" %*
    

    (You can use PATHEXT, assoc and ftype to make any file type executable.)

    0 讨论(0)
  • 2021-01-19 09:32

    Precedence is: DOSKEY Macro .COM .EXE .BAT

    http://support.microsoft.com/kb/35284

    0 讨论(0)
提交回复
热议问题