Link to home
Start Free TrialLog in
Avatar of npaun
npaun

asked on

How to programmatically get an exe file description?

How to programmatically get an exe file description? For instance, for "C:\Program Files (x86)\Internet Explorer\iexplore.exe", and for it, you would get "Internet Explorer" if you right click on the file, and look in the Properties>General for the Description label...

But how to do it programmatically, from your own program (VB6), having the exe file path? I suppose, an API function should do the job, but I can't find which one and an example for it...
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

I don't believe that Microsoft provides a way to retrieve that information. The SHGetFileInfo API can return a "description" but that "description" is "Application" for a VB6 exe.

If you can describe why you need the description then maybe there's another way to do it.
I think what you are after is the FileInfo class eg

Dim information As System.IO.FileInfo
information = My.Computer.FileSystem.GetFileInfo("C:\MyLogFile.log")

Open in new window


https://msdn.microsoft.com/en-us/library/system.io.fileinfo_members(v=vs.90).aspx
That's .Net code and the Asker is talking about VB6.
SOLUTION
Avatar of Michael Fowler
Michael Fowler
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of npaun
npaun

ASKER

PS: The approach I've found seems not to work on XP though...
However, this one seems to work on XP: https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4976&lngWId=1
Avatar of npaun

ASKER

I've found an exact solution from other sources...