运行对话框如何知道应用程序在哪里?

本文深入探讨了Windows系统中运行对话框如何定位并执行不在系统PATH环境变量中的应用程序。通过解释注册表中的AppPaths键,文章揭示了运行对话框能够找到特定应用程序位置的工作原理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

how-does-the-run-dialog-know-where-applications-are-00

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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值