Take the 2-minute tour ×

Is there any clear code to find an application installation path by EXE name?

I found this but it is usefulness at all.

Thank you!

share|improve this question
No, of course not. Not all applications write their installation path in the registry, and the ones that do will always use different path/key names. The only way you could be sure would be to search the hard drive for the exe name. –  Escobar Ceaser Jul 13 '12 at 14:15
@FrankWhite But if i know exactly that some of apps are installed. How I can do it? –  Clark Kent Jul 13 '12 at 14:17
The obvious way - if you are looking for set specific applications - is to do a regedit search for the exe after installing it. Then you can just check the same Reg Address in your code for other machines. This is not absolutely safe either though as versions of the app may use the reg differently (or not at all) and users may install differently (just me or all users etc) which could affect it. –  Wolf5370 Jul 13 '12 at 15:17
add comment

1 Answer

up vote 1 down vote accepted

If you know the registry path to the value that you want to read in you could do:

var key = Registry.LocalMachine.OpenSupKey("SOFTWARE\MyCompany\Data");
var value = key.GetValue("Location");

The registry access code is in Microsoft.Win32 namespace in the mscorelib.dll.

There are properties off of Registry for each of the registry hives, and for the registry key path you will not need to include the registry hive part.

For more information on the Registry Class and RegistryKey Class

share|improve this answer
add comment

Your Answer


