Locate an installed software in Windows using MATLAB

6 ビュー (過去 30 日間)
Mehdi
Mehdi 2015 年 4 月 25 日
コメント済み: Mehdi 2015 年 4 月 29 日
Hi,
Is it possible to find the location of an installed software in Windows using MATLAB? I need my MATLAB code to find the location of an installed application (exe file) and then run it. I found this string in stackoverflow website:
notepadEdit = winqueryreg('HKEY_CLASSES_ROOT','Applications\notepad.exe\shell\edit\command')
but it doesn't work for an app that is installed in program files.
Thank you in advance for any hint.
  1 件のコメント
Jan
Jan 2015 年 4 月 25 日
What do you know about the program you are looking for? Please provide this important detail, because we cannot guess it.

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2015 年 4 月 25 日
If you know the name of the executable and that it is installed in e.g. the "Program Files (x86)" folder:
[Result, WordPath] = system('WHERE /F /R "c:\Program Files (x86)" winword.exe')
system(WordPath)
  3 件のコメント
Jan
Jan 2015 年 4 月 26 日
And now, Mehdi? Did you try to run the WHERE command of the OS as I've suggested? Please consider, that I still do not know what "the name" means exactly. "Installed app" is not the same as "an exe file made by Matlab", so there is still the need to guess, what you exactly want. It would be easier, if you give an exact example.
Searching a file should be done on the operating system level. You can find millions of descriptions, when you search in the net for e.g. "windows batch find a file".
Mehdi
Mehdi 2015 年 4 月 29 日
Thank you for your explanations.
Yes I did run the WHERE command and it gave me the location. Thank you. It was slow though.
Here is the issue. Users of my app could install it anywhere in their computer, not necessarily in program files. I need to know where it's installed because there is a file that will be located next to the app in the installation folder and has to be run (or called) programmatically. So my app could have any name and it could be installed anywhere. Does that make sense?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

タグが未入力です。

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by