
The Run Dialog can serve as an easy and very useful way to open programs on your computer, but just how does it know where those applications are located at on your system? Today’s SuperUser Q&A post has the answer to a curious reader’s question.
“运行对话框”可以作为一种简单且非常有用的方式在计算机上打开程序,但是它如何知道这些应用程序在系统上的位置? 今天的“超级用户问答”帖子回答了一个好奇的读者的问题。
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.
今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。
问题 (The Question)
SuperUser reader mt025 wants to know how the Run Dialog knows where applications are that aren’t in Windows’ system PATH:
SuperUser阅读器mt025想知道“运行对话框”如何知道Windows系统PATH中没有应用程序的位置:
As a power user, I frequently use the Run Dialog. I can understand why the following commands work, as they are in the PATH environment variable.
作为高级用户,我经常使用“运行”对话框。 我能理解以下命令为何起作用,因为它们在PATH环境变量中 。
- mspaint mspaint
- diskmgmt.msc diskmgmt.msc
- explorer 探险家
These commands also work in CMD.
这些命令也可以在CMD中使用。
The commands below work in the Run Dialog, but they are not in the PATH environment variable, and they do not work in CMD.
下面的命令在“运行”对话框中有效,但它们不在PATH环境变量中,并且在CMD中不起作用。
- firefox 火狐
- winword Winword
- iexplore 探索
How does Run know where these files are?
Run如何知道这些文件在哪里?
答案 (The Answer)
SuperUser contributor w32sh has the answer for us:
超级用户贡献者w32sh为我们提供了答案:
When you execute a command from the Run Dialog, the system looks at the App Paths registry keys here:
当您从“运行”对话框执行命令时,系统将在此处查看“应用程序路径”注册表项:
- HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths HKEY_CURRENT_USER \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ App路径
and
和
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ App路径
Example
例
- HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\filezilla.exe HKEY_CURRENT_USER \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ App Paths \ filezilla.exe
(Default) value data has the full path to the executable. If it is not found, it looks at each folder included in the PATH, whereas CMD (the Command Prompt) does not reference these registry keys, it only searches the PATH.
( 默认 )值数据具有可执行文件的完整路径。 如果找不到,它将查看PATH中包含的每个文件夹,而CMD(命令提示符)不引用这些注册表项,而是仅搜索PATH 。
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.
有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程 。
翻译自: https://www.howtogeek.com/266469/how-does-the-run-dialog-know-where-applications-are/