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

时间:2011-07-26 10:17:14

标签: .net winforms installer command

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

提前感谢。

3 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:1)

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

答案 2 :(得分:1)

您必须在应用路径

中注册您的应用
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\
    MyApp.exe
        (Default) = <full-path-to>\MyApp.exe

有关更多技术细节,请参阅Finding an Application Executable Raymond Chen的博客文章How is it possible to run Wordpad by just typing its name even though it isn't on the PATH?也讨论了这个主题。

相关问题