Windows batch files: .bat vs .cmd?

前端 未结 13 1876
傲寒
傲寒 2020-11-22 17:01

As I understand it, .bat is the old 16-bit naming convention, and .cmd is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat fi

13条回答
  •  情深已故
    2020-11-22 17:28

    Still, on Windows 7, BAT files have also this difference : If you ever create files TEST.BAT and TEST.CMD in the same directory, and you run TEST in that directory, it'll run the BAT file.

    C:\>echo %PATHEXT%
    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    
    C:\Temp>echo echo bat > test.bat
    
    C:\Temp>echo echo cmd > test.cmd
    
    C:\Temp>test
    
    C:\Temp>echo bat
    bat
    
    C:\Temp>
    

提交回复
热议问题