.net - Is there a way to find a 'friendly' name for an executable given its path? -
i'm creating ui has buttons start number of .exe files in own thread.
i know path .exe files, i'm wanting display friendly application name rather file name of executable. of applications referenced big name applications microsoft word or skype; not in house exe files.
as example, path may be:
"c:\program files\microsoft office\office15\winword.exe"
but in ui want display button "word" on it.
i've noticed in registry many applications store friendlyappname
in area of registry can access follows:
command.text = microsoft.win32.registry.getvalue ( "hkey_local_machine\software\classes\applications\" + io.path.getfilename(path), "friendlyappname", io.path.getfilenamewithoutextension(path) )
but many applications name isn't present. know if there better way friendlyappname?
you can use filedescription property of fileversioninfo
class.
var info = fileversioninfo.getversioninfo( @"c:\program files (x86)\microsoft office\office14\winword.exe"); console.writeline(info.filedescription);
prints:
microsoft word
you might think productname
property makes more sense, if application belongs suite, productname
hold name of suite. example in case of word, microsoft office
.
Comments
Post a Comment