我想搜索并打开存储在我电脑中的软件。 [英] I want to search and open a software stored in my pc.

查看:47
本文介绍了我想搜索并打开存储在我电脑中的软件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想搜索一个软件,例如:Microsoft Word,并使用C ++ CLR中的Windows窗体应用程序打开它。



请帮帮我.. 。



我尝试了什么:



I want to search for a software, example:Microsoft Word, and open it by using a windows forms application in C++ CLR.

Please help me...

What I have tried:


进程::开始(%STARTMENU%// notepad.exe);

Process::Start("%STARTMENU%//notepad.exe");

推荐答案

这更难比你想象的那样:执行应用程序很简单 - 正如你所看到的那样只是提供Process :: Start的一个例子来提供Exe文件的路径。



问题是搜索 - 并非所有应用程序EXE都与可执行文件具有相同的名称。例如,Microsoft Word位于文件WinWord.exe中,Visual Studio位于devenv.exe中。而且很多内置应用程序都位于程序文件下的Windows应用程序隐藏文件夹中,这也需要管理员访问权限才能读取,因此您需要提升才能在其中进行搜索。



因此,根据您希望用户搜索的内容,可能更容易获得他可以访问的已知应用程序列表 - 取决于您究竟是什么正试图这样做。
That's harder than you might think: executing the app is simple - as you've seen it's just a case of providing Process::Start with a path to the Exe file.

The problem is searching - not all app EXE's have the same name as the executable. For example, "Microsoft Word" is in the file "WinWord.exe", and "Visual Studio" is "devenv.exe". And quite a lot of "built in" apps are in the hidden folder "Windows Apps" under "Program files", which also requires Admin access permissions to read, so you app would need elevation to search in there at all.

So depending on what you want to allow the user to search for it might be simpler to just have a list of "known apps" that he can access - depends on what exactly you are trying to do.


这篇关于我想搜索并打开存储在我电脑中的软件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆