绑定运行框命令来启动应用程序

发布于 2024-11-26 09:19:15 字数 105 浏览 2 评论 0原文

我使用 C# 为我的 Windows 应用程序创建了一个安装程序。安装应用程序后,我希望我的用户在“运行”框对话框中输入命令并从那里启动应用程序。我怎样才能做到这一点?

提前致谢。

I have created an installer for my windows application using C#. After installing the application i want my users to type in a command in Run box dialog and start the application from there. How i can achieve this ?

thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

莫相离 2024-12-03 09:19:15

您必须将应用程序安装在 PATH 中的目录之一中。这样,当用户在运行框中键入 exe 名称时,应用程序将启动

You must install your application in one of the directories that are in PATH. This way, when the user types the exe name in the Run box, the application will launch

沩ん囻菔务 2024-12-03 09:19:15

他们需要输入应用程序的完整路径,例如%ProgramFiles%\MyFolder\MyApp.exe

They will need to enter the full path to the application, e.g. %ProgramFiles%\MyFolder\MyApp.exe.

清晨说晚安 2024-12-03 09:19:15

您必须在应用程序路径中注册您的应用程序:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\
    MyApp.exe
        (Default) = <full-path-to>\MyApp.exe

请参阅查找可执行应用程序以获取更多技术细节。
Raymond Chen 的博客文章 如何运行写字板即使它不在 PATH 上,也只需键入其名称? 也讨论了这个主题。

You have to register your application in App Paths:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\
    MyApp.exe
        (Default) = <full-path-to>\MyApp.exe

See Finding an Application Executable for more technical details.
Raymond Chen'd blog post How is it possible to run Wordpad by just typing its name even though it isn't on the PATH? also discusses this very subject.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文