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

有些话、适合烂在心里 提交于 2019-12-01 23:30:36

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.)

Precedence is: DOSKEY Macro .COM .EXE .BAT

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!