<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; WSH: Получение информации о свойствах исполняемого файла]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=5600&amp;type=atom" />
	<updated>2011-03-18T23:23:42Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5600</id>
		<entry>
			<title type="html"><![CDATA[Re: WSH: Получение информации о свойствах исполняемого файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46374#p46374" />
			<content type="html"><![CDATA[<p>Вот спасибо, это самое оно! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Аскет]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25748</uri>
			</author>
			<updated>2011-03-18T23:23:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46374#p46374</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: WSH: Получение информации о свойствах исполняемого файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46373#p46373" />
			<content type="html"><![CDATA[<p>В довесок, могу предложить вот такую функцию<br /></p><div class="codebox"><pre><code>Option Explicit

Dim i, Attribute, AttributeList

For i=0 To 100
    AttributeList = AttributeList &amp; i &amp; &quot;)&quot; &amp; GetFileAttribute(&quot;C:\1.doc&quot;,i) &amp; VbCrLf
Next

MsgBox AttributeList

Function GetFileAttribute(FileName,Attribute)
    Dim ShellApplication, Path, Name, Folder, FolderItem
    Set ShellApplication = CreateObject(&quot;Shell.Application&quot;)
    Path = Left(FileName, InStrRev(FileName, &quot;\&quot;) - 1)
    Name = Mid(FileName,InStrRev(FileName, &quot;\&quot;) + 1)
    Set Folder = ShellApplication.NameSpace(Path)
    Set FolderItem = Folder.ParseName(Name)
    GetFileAttribute = Folder.GetDetailsOf(FolderItem,Attribute)
End Function</code></pre></div><p>Либо класс модуль.&nbsp; Конечно кода чуть больше. Но работать будет шустрее. Т.к нет необходимости каждый раз грузить объекты и &quot;подключение&quot; к файлу происходит 1 раз.<br /></p><div class="codebox"><pre><code>Option Explicit

Dim i, OleDocumentProperties, AttributeList, AttributeValue

Set OleDocumentProperties = New clsOleDocumentProperties

OleDocumentProperties.OpenFile &quot;C:\1.doc&quot;

For i = 0 To 100
    AttributeValue = OleDocumentProperties.GetAttributeValue(i)
    If AttributeValue &lt;&gt; &quot;&quot; Then AttributeList = AttributeList &amp; i &amp; &quot;)&quot; &amp; OleDocumentProperties.GetAttributeName(i) &amp; &quot;: &quot; &amp; AttributeValue &amp; VbCrLf
Next

MsgBox AttributeList

Class clsOleDocumentProperties
    Private ShellApplication, Folder, FolderItem, Parsed
    Sub Class_Initialize
        Set ShellApplication = CreateObject(&quot;Shell.Application&quot;)
    End Sub
    
    Sub OpenFile(FileName)
        On Error Resume Next
        Parsed = False
        Dim Path, Name
        Path = Left(FileName, InStrRev(FileName, &quot;\&quot;) - 1)
        Name = Mid(FileName,InStrRev(FileName, &quot;\&quot;) + 1)
        Set Folder = ShellApplication.NameSpace(Path)
        Set FolderItem = Folder.ParseName(Name)
        if Err.number &lt;&gt; 0 or FolderItem is Nothing Then 
            On Error Goto 0
            Err.Raise vbObjectError + 1,&quot;OpenFile&quot;,&quot;Не удалось открыть файл &quot;&quot;&quot; &amp; FileName &amp; &quot;&quot;&quot;&quot;
        End if
        Parsed = True
    End Sub

    Function GetAttributeValue(index)
        if Parsed Then GetAttributeValue = Folder.GetDetailsOf(FolderItem,index)
    End Function

    Function GetAttributeName(index)
        if Parsed Then GetAttributeName = Folder.GetDetailsOf(,index)
    End Function
End Class</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2011-03-18T21:14:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46373#p46373</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: WSH: Получение информации о свойствах исполняемого файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46372#p46372" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=38">Серый форум / VBScript: чтение расширенных свойств файлов</a></p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-03-18T21:12:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46372#p46372</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: WSH: Получение информации о свойствах исполняемого файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46371#p46371" />
			<content type="html"><![CDATA[<p>Думаю Вам поможет метод <strong>GetDetailsOf</strong><br />По этой ссылке можно найти информацию о нём<br /><a href="http://www.google.ru/#hl=ru&amp;xhr=t&amp;q=GetDetailsOf&amp;cp=9&amp;pf=p&amp;sclient=psy&amp;newwindow=1&amp;site=&amp;source=hp&amp;aq=0&amp;aqi=&amp;aql=&amp;oq=GetDetail&amp;pbx=1&amp;fp=8e88961366b4d746">http://www.google.ru/#hl=ru&amp;xhr=t&a … 1366b4d746</a></p><p>А здесь уже готовые примеры <br /><a href="http://msdn.microsoft.com/en-us/library/bb787870(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library … s.85).aspx</a></p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2011-03-18T20:58:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46371#p46371</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[WSH: Получение информации о свойствах исполняемого файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46370#p46370" />
			<content type="html"><![CDATA[<p>Каким образом (не прибегая к сторонним инструментам) можно извлечь информацию из исполняемого файла DLL/OCX/EXE?<br />&nbsp; &nbsp;(Свойства файла -&gt; Вкладка «Версия»)</p><p>В частности интересует графа &quot;Описание&quot;.</p>]]></content>
			<author>
				<name><![CDATA[Аскет]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25748</uri>
			</author>
			<updated>2011-03-18T20:40:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46370#p46370</id>
		</entry>
</feed>
