Вот ещё функция для получения свойств файла:
Код:

#include <Array.au3>
$aProperties = _FileGetExtProperty(@AutoItExe, -1)
_ArrayDisplay($aProperties)
;===============================================================================
; Function Name: _FileGetExtProperty($sPath, $iProp)
; Description: Returns an extended property of a given file.
; Parameter(s): $sPath - The path to the file you are attempting to retrieve an extended property from.
; $iProp - The numerical value for the property you want returned. If $iProp is is set
; to -1 then all properties will be returned in a 1 dimensional array in their corresponding order.
; The properties are as follows:
; # Windows XP / Windows Server 2003 | Windows 2000
; 0 Name Name
; 1 Size Size
; 2 Type Type
; 3 Date Modified Date Modified
; 4 Date Created Attributes
; 5 Date Accessed Comment
; 6 Attributes Date Created
; 7 Status Date Accessed
; 8 Camera Model Owner
; 9 Author ???
; 10 Title Author
; 11 Duration Title
; 12 Category Subject
; 13 Pages Category
; 14 Owner Pages
; 15 Copyright Copyright
; 16 Artist Company Name
; 17 Genre Module Desription
; 18 Protected Module Version
; 19 Comments Product Name
; 20 Album Title Product Version
; 21 Subject Sender Name
; 22 Dimensions Recipient Name
; 23 Year Recipient Number
; 24 Track Number Csid
; 25 Date Picture Taken Tsid
; 26 Bit Rate Transmission Time
; 27 ??? Caller Id
; 28 ??? Routing
; 29 ??? Audio Format
; 30 Company Sample Rate
; 31 Description Audio Sample Size
; 32 File Version Channels
; 33 Product Name Play Length
; 34 Product Version Frame Count
; 35 ??? Frame Rate
; 36 ??? Video Sample Size
; 37 ??? Video Compression
; Requirement(s): File specified in $spath must exist.
; Return Value(s): On Success - The extended file property, or if $iProp = -1 then an array with all properties
; On Failure - 0, @Error - 1 (If file does not exist)
; Author(s): Simucal (Simucal@gmail.com), Mod. by G.Sandler (a.k.a CreatoR)
; Note(s):
;
;===============================================================================
Func _FileGetExtProperty($sPath, $iProp)
Local $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty
If Not FileExists($sPath) Then Return SetError(1, 0, 0)
$sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1))
$sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1)))
$oShellApp = ObjCreate("shell.application")
$oDir = $oShellApp.NameSpace($sDir)
$oFile = $oDir.ParseName($sFile)
If $iProp = -1 Then
Local $aProperty[35]
For $i = 0 To 34
$aProperty[$i] = $oDir.GetDetailsOf($oFile, $i)
Next
Return $aProperty
EndIf
$sProperty = $oDir.GetDetailsOf($oFile, $iProp)
If $sProperty = "" Then Return 0
Return $sProperty
EndFunc ;==>_FileGetExtProperty
Цитата amel27:
Func _FileGetOwner($sFile, $sComputer = ".") »
|
У меня она возвращает пустую строку
