简体   繁体   English

为什么“启动firefox”命令在Windows命令提示符下有效?

[英]Why does “start firefox” command works in Windows command prompt?

I'm curious why commands like "start iexplore" and "start firefox" work in Windows cmd. 我很好奇为什么像“启动iexplore”和“启动firefox”这样的命令在Windows cmd中工作。 They're not standalone commands. 它们不是独立的命令。 If you try to type in just "firefox", you'll get: "'firefox' is not recognized as an internal or external command, operable program or batch file." 如果你尝试只输入“firefox”,你会得到:“'firefox'不被识别为内部或外部命令,可操作程序或批处理文件。”

This leads to the conclusion that this is a special behaviour of the "start" command. 这导致得出结论,这是“开始”命令的特殊行为。 My first guess was that it works in a similar way to how the %path% variable is used, having known directories to search in. I ruled it out easily by trying to run "start [executable]" for another executable located in the same directory as firefox. 我的第一个猜测是,它的工作方式与使用%path%变量的方式类似,有已知的目录可供搜索。我通过尝试为另一个可执行文件运行“start [executable]”来轻松排除它目录为firefox。

My conclusion is that somewhere on my computer there's a list of designated file paths, that can be started by simply typing their file name after the "start" command, instead of the entire path. 我的结论是,在我的计算机上的某个地方有一个指定文件路径列表,可以通过在“start”命令后输入文件名而不是整个路径来启动。

Imagine the potential of being able to add things to this list.. Anyone knows where I can find it? 想象一下能够在这个列表中添加东西的潜力..任何人都知道我在哪里可以找到它?

It is in the registry 它在注册表中

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\

Under this key there are defined applications that can be invoked without need to change the path environment variable. 在此密钥下,可以调用已定义的应用程序,而无需更改路径环境变量。

Usual invocation (typing the name in the command line) will not search inside this list, but call to start command, windows Run dialog or call from anything that uses the ShellExecute or ShellExecuteEx API calls, will check for applications defined in this list. 通常调用(在命令行中键入名称)不会在此列表中搜索,但调用start命令,Windows Run对话框或从使用ShellExecuteShellExecuteEx API调用的任何内容调用,将检查此列表中定义的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM