- A folder on the search path
- In a folder on the search path
- The current folder
- In the current folder.
How to check if an (.exe) file is installed or not?
17 views (last 30 days)
Show older comments
Wael Wanis
on 27 Oct 2019
Commented: Noah Kilps
on 5 Nov 2020
Hello everyone,
I am using MATLAB R2019b on windows 10.
I am designing a GUI, i need when the user pushes the Start button, MATLAB automatically checks if "FreeFem++" program is installed on the device or not?
i read about the command:
exist launchff++.exe
But it only searches in the current folder where the GUI exists, not on all the device.
And if the program is installed, I don't know its location.
So how can i search for the file everywhere or more importantly in the control panel?
I tried:
exist 'Control Panel\Programs\Programs and Features'
but it doesn't work, apparently exist command doesn't have access to search in the control panel.
Thank you in advance.
3 Comments
Accepted Answer
Hari Krishna Ravuri
on 31 Oct 2019
system is used to execute operating system command and return the output.The function starts a new cmd/shell process, executes the command, exits the process, and returns to the MATLAB process.Please refer https://in.mathworks.com/help/matlab/ref/system.html for more information regarding system.
In this case,as you are using a Windows10 machine, you may consider executing the below instruction to get the list of installed applications.
system("wmic product get name,version")
Hope this helps!
2 Comments
Noah Kilps
on 5 Nov 2020
Hello,
I have a follow up question to this. What if I only want to know if excel is installed? how would
system("wmic product get name,version")
be written differently?
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!