Retrieving file installation path from registry

后端 未结 3 1741
谎友^
谎友^ 2021-01-18 14:44

I am creating a WPF utility which needs to access the registry of the local machine, to then find out the installation path of the program.

I\'ve navigated to the ke

3条回答
  •  萌比男神i
    2021-01-18 15:04

    I solved my problem, to anyone who wants a solution in the future if your still stuck after this please message me, I found it was hard to find the resources.

    RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths\myexe.exe");
    string regFilePath = null;
    
    object objRegisteredValue = key.GetValue("");
    
    registeredFilePath = value.ToString();
    

提交回复
热议问题