Windows在PATH中搜索可执行文件的相对顺序是什么? [英] What's the relative order with which Windows search for executable files in PATH?

查看:87
本文介绍了Windows在PATH中搜索可执行文件的相对顺序是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有a.com,a.cmd,a.bat和a.exe文件%PATH%,如果仅调用命令"a",Windows将选择哪一个文件?这是M $官方指定的某个地方吗?

If I have a.com, a.cmd, a.bat, and a.exe files %PATH%, which one would Windows pick if I invoke just the command "a"? Is this officially spec-ed somewhere by M$?

我只是想用-n包裹我的gvim.exe可执行文件,但是我的gvim.bat似乎既没有从命令行运行,也没有从运行对话框运行.

I just wanted to wrap my gvim.exe executable with -n, but my gvim.bat doesn't appear to get run neither from the command line, nor from the Run dialog.

推荐答案

请参见

See the command search sequence on Microsoft Technet

PATH和PATHEXT环境变量分别提供搜索序列的元素:PATH是要查找的目录" where "的有序列表,而PATHEXT是文件扩展名的有序列表(" what )来查找(如果扩展名未在命令行上明确提供).但是,在使用PATH之前,将搜索当前目录.

The PATH and PATHEXT environmental variables each provide an element of the search sequence: PATH is the ordered list of directories "where" to look, and PATHEXT is the ordered list of file extensions ("what") to look for (in case the extension isn't explicitly provided on the command line). Prior to using the PATH however, the current directory is searched.

PATHEXT变量默认为".COM; .EXE; .BAT; .CMD"

The PATHEXT variable defaults to ".COM;.EXE;.BAT;.CMD"

这篇关于Windows在PATH中搜索可执行文件的相对顺序是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆