Hallo,
hat jemand eine Idee, wie man die Dateiinfos einer Datei auslesen kann (Titel/Betreff/Autor....) ???
eddy_erpel
Hallo,
hat jemand eine Idee, wie man die Dateiinfos einer Datei auslesen kann (Titel/Betreff/Autor....) ???
eddy_erpel
hm, vieleicht mit hilfe von ResHack.
das ganze in einen Autoit mit rein bauen
HI,
vielleicht hilft dir das hier:
;===============================================================================
; Function Name: GetExtProperty($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:
; Name = 0
; Size = 1
; Type = 2
; DateModified = 3
; DateCreated = 4
; DateAccessed = 5
; Attributes = 6
; Status = 7
; Owner = 8
; Author = 9
; Title = 10
; Subject = 11
; Category = 12
; Pages = 13
; Comments = 14
; Copyright = 15
; Artist = 16
; AlbumTitle = 17
; Year = 18
; TrackNumber = 19
; Genre = 20
; Duration = 21
; BitRate = 22
; Protected = 23
; CameraModel = 24
; DatePictureTaken = 25
; Dimensions = 26
; Width = 27
; Height = 28
; Company = 30
; Description = 31
; FileVersion = 32
; ProductName = 33
; ProductVersion = 34
; 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)
; Note(s):
;
;===============================================================================
#include <array.au3>
$path = FileOpenDialog("Select a file to read attributes",@ScriptDir,"All (*.*)")
$prop = _GetExtProperty($path,-1)
_ArrayDisplay($prop,"Property Array")
Func _GetExtProperty($sPath, $iProp)
Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty
$iExist = FileExists($sPath)
If $iExist = 0 Then
SetError(1)
Return 0
Else
$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
Else
$sProperty = $oDir.GetDetailsOf ($oFile, $iProp)
If $sProperty = "" Then
Return 0
Else
Return $sProperty
EndIf
EndIf
EndIf
EndFunc ;==>_GetExtProperty
Alles anzeigen
So long,
Mega
XN Resource Editor damit sollte es gehen.
@th.merger
Danke, genau das habe ich gesucht.[Blockierte Grafik: http://autoit.aufwaerts.de/images/smilies/party_55.gif]
Zeile 64 müsste aber so lauten:
eddy_erpel
HI,
schön dass ich helfen konnte.
Zu deiner Anmerkung: Sehr seltsam. In dem Skript aus dem ich kopiert habe ist alles okay.
Seltsam.
So long,
Mega
Hi,
seltsam. Bei mir läuft da gar nichts wenn ich nicht nach dem "\" Suche in StringInStr, da bei mir dann immer $sDir="" raus kommt, was ja auch richtig wäre.
eddy_erpel
HI,
ja deine Anmerkung war auch vollkommen richtig. Ich meinte nur, dass in meiner Datei, aus der ich kopiert habe der "\" auch drin ist.
Irgendwie wurde er nur nicht mitkpoiert. Das ist das, was mich verwundern ließ.
So long,
Mega
HI,
nochmal. Jetzt kommt das Schlimmste, wenn ich auf Beitrag ändern klicke um den Fehler zu beheben, dann muss ich mit Verwunderung feststellen, dass der \ vorhanden ist.
Scheint ein Fehler in der Darstellung zu sein.
peethebee : Vielleicht kannst du dir das mal angucken.
So long,
Mega
Das liegt wahrscheinlich an den PHP-Tags ersetze sie mal durch die CODE-tags!
Hi,
Ich poste es einfach nochmal hier, aber diesmal mit Code-Tags. Auf diese Weise sammel ich noch einen Post.
1
;===============================================================================
; Function Name: GetExtProperty($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:
; Name = 0
; Size = 1
; Type = 2
; DateModified = 3
; DateCreated = 4
; DateAccessed = 5
; Attributes = 6
; Status = 7
; Owner = 8
; Author = 9
; Title = 10
; Subject = 11
; Category = 12
; Pages = 13
; Comments = 14
; Copyright = 15
; Artist = 16
; AlbumTitle = 17
; Year = 18
; TrackNumber = 19
; Genre = 20
; Duration = 21
; BitRate = 22
; Protected = 23
; CameraModel = 24
; DatePictureTaken = 25
; Dimensions = 26
; Width = 27
; Height = 28
; Company = 30
; Description = 31
; FileVersion = 32
; ProductName = 33
; ProductVersion = 34
; 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)
; Note(s):
;
;===============================================================================
#include <array.au3>
$path = FileOpenDialog("Select a file to read attributes",@ScriptDir,"All (*.*)")
$prop = _GetExtProperty($path,-1)
_ArrayDisplay($prop,"Property Array")
Func _GetExtProperty($sPath, $iProp)
Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty
$iExist = FileExists($sPath)
If $iExist = 0 Then
SetError(1)
Return 0
Else
$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
Else
$sProperty = $oDir.GetDetailsOf ($oFile, $iProp)
If $sProperty = "" Then
Return 0
Else
Return $sProperty
EndIf
EndIf
EndIf
EndFunc ;==>_GetExtProperty
Alles anzeigen
Ps: Funktioniert tadellos.
So long,
Mega
Hi,
ja, jetzt sieht es gut aus. Irgendwo scheint er sich verschluckt zu haben. Nobody's perfect, nicht einmal der Computer. [Blockierte Grafik: http://autoit.aufwaerts.de/images/icons/icon5.gif]
eddy_erpel
HI,
ich bin mir sicher, der Computer macht alles so, wie man es ihn sagt, nur die Syntax des scripts stimmt wahrscheinlich nicht 100 %ig.
Na ja, weitermachen ...
So long,
Mega