none
How to get properties of executable file (applicaiton)?

    Pergunta

  • Hi all,

    does anyone know Windows scripting API (Jscirpt/VBscript) to get the properties of executable file (like shown in the "Properties" dialog of the file).
    I need to get the icon (as image file), file description and the publisher properties of the executable file (applicaiton).

    Any kind of solutions are appreciated: using WMI, modifying registry or using Windows built in command line utilities.

    Thanks in advance!!

    quinta-feira, 12 de janeiro de 2012 13:20

Respostas

Todas as Respostas

  • Hi all,

    does anyone know Windows scripting API (Jscirpt/VBscript) to get the properties of executable file (like shown in the "Properties" dialog of the file).
    I need to get the icon (as image file), file description and the publisher properties of the executable file (applicaiton).

    Any kind of solutions are appreciated: using WMI, modifying registry or using Windows built in command line utilities.

    Thanks in advance!!

    Are you asking about the file metadata - the information that shows on the extended properties page?

     http://blogs.technet.com/b/heyscriptingguy/archive/2008/08/13/how-can-i-find-files-metadata.aspx


    jv
    quinta-feira, 12 de janeiro de 2012 13:22
  • Just to add to that, the GetDetailsOf function of the Shell.Application object can get most of the data, but is OS dependent and cannot return anything about an embedded icon.  For example, in XP it returns just 40 properties (of which some are not populated), while Win7(Vista?) supports 286 and the order between the two OSs is different, as well.  It also cannot change or create any of that information, just report it.  MS does supply another object, free for download, that has read/write support for the properties, called DSOFile.OleDocumentProperties

    I have no idea how to access the icon(s) information via script.


    Tom Lavedas
    quinta-feira, 12 de janeiro de 2012 14:47
    Moderador
  • Just to add to that, the GetDetailsOf function of the Shell.Application object can get most of the data, but is OS dependent and cannot return anything about an embedded icon.  For example, in XP it returns just 40 properties (of which some are not populated), while Win7(Vista?) supports 286 and the order between the two OSs is different, as well.  It also cannot change or create any of that information, just report it.  MS does supply another object, free for download, that has read/write support for the properties, called DSOFile.OleDocumentProperties

    I have no idea how to access the icon(s) information via script.


    Tom Lavedas


    Good points.  Icon information is done only through associations except in links which can have an associated icon file.

    DSOFile object probably does not work on Vista and later and it only works on MSOffice files and OLE files that use structured storage which is proprietary to Microsoft and seldom used by other vendors.

    The KB has instructions for updating accessto the DLL for Net system.  It will work with Office 2003 on XP and WS2003 but it may fail on Vista.  To get a Vista Office 2007 compatible version you need to install the Office compatibility pack which comes with an updated DSOFile dll.

    DSOFile DLL source code is also in one of the platform SDKs I believe.

    Lots of choices.

     

     


    jv
    quinta-feira, 12 de janeiro de 2012 15:03
  • Hi,

    thanks a lot and sorry for late relpy!!

    This file "metadata" is the very thing I was searching for!!

    The only thing, I would like to note, that "GetDetailsOf" method retuns the file properties in textual format e.g:
    "File description : Skype
    Company : Skype Technologies S.A."
    and I had to parse this string to get each propety value.

    Also, this text is in the local system language.

    segunda-feira, 20 de fevereiro de 2012 06:23
  • Hi,

    thanks a lot and sorry for late relpy!!

    This file "metadata" is the very thing I was searching for!!

    The only thing, I would like to note, that "GetDetailsOf" method retuns the file properties in textual format e.g:
    "File description : Skype
    Company : Skype Technologies S.A."
    and I had to parse this string to get each propety value.

    Also, this text is in the local system language.

    That is exactly as stated above.

    The GetDetailsOf method returns the property name from the folder accesx and the value from the file access.  You only need to access one of these.  Apparently you are looking at the script as a solution when it is really only a demonstration.

    The results here are for technicians and not end users.  There is no commandline end user solution for what you are asking althought there are likely third party utilities that can get what you are asking for.

    This is an adminstrative scripting forum.  The suggestions assume some basic technical understanding of Windows and scripting. 

    Alxo, you are not being clear about what it is you are after.  You specifically asked about icons.  This can only be obtained by retrieving the icon of the 'associated' program.  Each program file may have an associated icon that can be in the exe or located elsewhere.  The EXEs resources determine where that icon is.  The system APIs can retrieve this info.  It is not normally available to scripting languages.

    GetDetailsOf is useful for returning some, but not all, of the properties of an object.  In Explorer the object may have support beyond the old DSOFile object.

    Office documents have support for Explorer that goes beyond the usual properties.  This capability is undocumented as far as I can tell.

    This issue comes up repeatedly in this and other forums.  There are many scripts in the repository that enumerate the FS properties.

    You also note that the output is in the local system language.  This is absolutely normal. VBScript has limited support for multiple languages.  If you need to suport MUI then you should look into using PowerShell as it can adjust for culture in most cases.

    MOst of your issues seem to be about the environment and not about script.  Perhaps you shoul do some studying of Windows technolgy.  There are books on WIndows NT Internals and the Win32 Api which are a good starting place.  If you are just an end user then you would probably do better in the forum for the WIndows OS you are interested in.

    Yes-yes.. I know.  It is a pain in the neck but, unfortunately, you have stumbled on a requirement that is not normally available to users.  Its exisitance is mainly to support third party extensions to Explorer and vendor appliactionw. It is not an end user tool. Unfortunately Microsoft did not provide an end user component outside of Explorer.  The old DSOFie object has been included Xp in teh Shell to allow for access to properties but it is old and does not account for vendor Explorere extensions.

    What you see on the screen in Explorer is intriguing and I agree - it is too bad the MS did not provide a comprehensive scriptin ginterface to access all of this infoe. The 'shell' is the closest you will get.


    ¯\_(ツ)_/¯


    • Editado jrv segunda-feira, 20 de fevereiro de 2012 07:11
    segunda-feira, 20 de fevereiro de 2012 06:50
  • Thanks a lot for detailed answer!!
    segunda-feira, 20 de fevereiro de 2012 06:58
  • [unfortunately the above answer was truncated by the posting.  Here is the full text"]

    That is exactly as stated above.

    The GetDetailsOf method returns the property name from the folder accesx and the value from the file access.  You only need to access one of these.  Apparently you are looking at the script as a solution when it is really only a demonstration.

    The results here are for technicians and not end users.  There is no commandline end user solution for what you are asking althought there are likely third party utilities that can get what you are asking for.

    This is an adminstrative scripting forum.  The suggestions assume some basic technical understanding of Windows and scripting. 

    Alxo, you are not being clear about what it is you are after.  You specifically asked about icons.  This can only be obtained by retrieving the icon of the 'associated' program.  Each program file may have an associated icon that can be in the exe or located elsewhere.  The EXEs resources determine where that icon is.  The system APIs can retrieve this info.  It is not normally available to scripting languages.

    GetDetailsOf is useful for returning some, but not all, of the properties of an object.  In Explorer the object may have support beyond the old DSOFile object.

    Office documents have support for Explorer that goes beyond the usual properties.  This capability is undocumented as far as I can tell.

    This issue comes up repeatedly in this and other forums.  There are many scripts in the repository that enumerate the FS properties.

    You also note that the output is in the local system language.  This is absolutely normal. VBScript has limited support for multiple languages.  If you need to suport MUI then you should look into using PowerShell as it can adjust for culture in most cases.

    MOst of your issues seem to be about the environment and not about script.  Perhaps you shoul do some studying of Windows technolgy.  There are books on WIndows NT Internals and the Win32 Api which are a good starting place.  If you are just an end user then you would probably do better in the forum for the WIndows OS you are interested in.

    Yes-yes.. I know.  It is a pain in the neck but, unfortunately, you have stumbled on a requirement that is not normally available to users.  Its exisitance is mainly to support third party extensions to Explorer and vendor appliactionw. It is not an end user tool. Unfortunately Microsoft did not provide an end user component outside of Explorer.  The old DSOFie object has been included Xp in teh Shell to allow for access to properties but it is old and does not account for vendor Explorere extensions.

    What you see on the screen in Explorer is intriguing and I agree - it is too bad the MS did not provide a comprehensive scriptin ginterface to access all of this infoe. The 'shell' is the closest you will get.


    ¯\_(ツ)_/¯

    segunda-feira, 20 de fevereiro de 2012 07:12