|
You last visited: Today at 14:12
Advertisement
Informationen über eine Datei auslesen
Discussion on Informationen über eine Datei auslesen within the AutoIt forum part of the Coders Den category.
01/01/2011, 21:35
|
#1
|
elite*gold: 0
Join Date: Nov 2010
Posts: 74
Received Thanks: 24
|
Informationen über eine Datei auslesen
Hi epvp,
Ich wüsste gerne ob es eine möglichkeit gibt, Informationen über eine Datei auszulesen wie zum Beispiel Autor, Version ect. (rechtsklick auf beliebige Datei, Eigenschaften, das tab wechseln, hier kann man autor , version, kurzbeschreibung ect einstellen)
Danke für eure hilfe
AutoitScript
|
|
|
01/01/2011, 21:46
|
#2
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
|
google hilft immer...
PHP Code:
;=============================================================================== ; 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
|
|
|
01/01/2011, 21:57
|
#3
|
elite*gold: 0
Join Date: Nov 2010
Posts: 74
Received Thanks: 24
|
Danke perfekt.
Ich habe in google auch in der SuFu hier gesucht aber nichts gefunden.
|
|
|
01/01/2011, 21:58
|
#4
|
elite*gold: 0
Join Date: Nov 2010
Posts: 74
Received Thanks: 24
|
Danke perfekt.
Ich habe in google auch in der SuFu hier gesucht aber nichts gefunden.
Edit: keine ahnung warum das zwei mal da ist...
|
|
|
01/01/2011, 22:05
|
#5
|
elite*gold: 2
Join Date: Mar 2008
Posts: 1,778
Received Thanks: 1,222
|
Lösch einfach deinen 2. Post.
|
|
|
01/02/2011, 11:45
|
#6
|
elite*gold: 0
Join Date: Jul 2010
Posts: 475
Received Thanks: 130
|
Bei mir kommt ein Fehler:
C:\Dokumente und Einstellungen\Administrator\Desktop\Neu AutoIt v3 Script.au3 (67) : ==> The requested action with this object has failed.:
$oFile = $oDir.Parsename ($sFile)
$oFile = $oDir.Parsename ($sFile)^ ERROR
>Exit code: 1 Time: 3.124
pls help
EDIT: Kann keiner helfen?
|
|
|
01/02/2011, 14:33
|
#7
|
elite*gold: 29
Join Date: Nov 2010
Posts: 502
Received Thanks: 127
|
Quote:
Originally Posted by V8II
Bei mir kommt ein Fehler:
C:\Dokumente und Einstellungen\Administrator\Desktop\Neu AutoIt v3 Script.au3 (67) : ==> The requested action with this object has failed.:
$oFile = $oDir.Parsename ($sFile)
$oFile = $oDir.Parsename ($sFile)^ ERROR
>Exit code: 1 Time: 3.124
pls help
EDIT: Kann keiner helfen?
|
dann poste den script. mein gott. dass man das immer sagen muss. ich meine, wie sollen wir dir anständig helfen können, wenn du uns nur die Fehlermeldung schickst?
|
|
|
01/02/2011, 14:38
|
#8
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
|
u_failed:
schau mal weiter oben
V8II:
hmm..mal versucht als admin auszuführen?
#reqire admin einzufügen?
|
|
|
01/02/2011, 17:05
|
#9
|
elite*gold: 0
Join Date: Jul 2010
Posts: 475
Received Thanks: 130
|
Nein funktioniert nicht außerdem habe ich Windows XP, da muss man normalerweise nie als Admin ausführen.
Edit:
Hier nochmal für u_failed ^^
Code:
#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
Edit2: Funktioniert es bei euch?
|
|
|
01/02/2011, 22:42
|
#10
|
elite*gold: 0
Join Date: Nov 2010
Posts: 74
Received Thanks: 24
|
Push
Hatte am Nachmittag noch keine Zeit um zu testen aber ich habe das selbe Problem.
Auch ich benutze windows xp
@V8II
Ich habe ein ähnliches Script im Internet gefunden, hier kommt kein Fehler jedoch wird kein Wert zurückgeliefert ich schicke es dir mal per PM
|
|
|
01/03/2011, 11:55
|
#11
|
elite*gold: 0
Join Date: Jul 2010
Posts: 475
Received Thanks: 130
|
Danke funtzt wie in PN besprochen
|
|
|
01/03/2011, 13:01
|
#12
|
elite*gold: 0
Join Date: Sep 2010
Posts: 487
Received Thanks: 196
|
Quote:
Originally Posted by V8II
Nein funktioniert nicht außerdem habe ich Windows XP, da muss man normalerweise nie als Admin ausführen.
Edit:
Hier nochmal für u_failed ^^
Code:
#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
Edit2: Funktioniert es bei euch?
|
also bei mir nicht^^ welche autoit version hast du den?
also ich habe diese funktion noch nie gebraucht werde ich auch nicht
bin ma neugirig: Wozu Dient es wenn ich fragen darf?
|
|
|
01/03/2011, 18:11
|
#13
|
elite*gold: 2
Join Date: Mar 2008
Posts: 1,778
Received Thanks: 1,222
|
Lesen bildet:
Quote:
|
Returns an extended property of a given file.
|
|
|
|
01/03/2011, 18:33
|
#14
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
|
hmm komisch das es bei euch nciht funtz o.O
bei mir klappts ganz normal.
|
|
|
 |
Similar Threads
|
Angeklickte Datei auslesen
12/14/2010 - AutoIt - 0 Replies
Hi,
Ich habe mir ein Programm macht das den Inhalt der Datei ausliest die man anglickt nur ich habe leider kein plan wie es geht den Pfad von angeklickte Datein auszulesen?
Also nochmal anders : Hab in der Shellvon AutoIT eine neue Rechtsklick Opton hinzugefügt und jetzt will ih das AutoIT den Datei Pfad zu der Datei ausliest auf die man Rechtklick gemacht hatt.
|
txt Datei - Zeilen auslesen und verwenden
07/03/2010 - AutoIt - 16 Replies
So hab jetzt wieder mal eine Frage an euch :D
Erstmal: Was ich bauen will ist ein kleiner TeleportBot.
Er soll die Koordinaten aus einer Textdatei auslesen und sie im Bot benutzen.
Hier ist mal ein Picture von den Koordinaten im Editor^
http://www.imagebanana.com/img/ack9eeyc/koords.pn g
Ich bin bis jetzt soweit gekommen dass ich die Datei öffnen kann also im Bot.
Nur jetzt weiß ich auch nicht mehr weiter..
|
DAtei-Speicherort auslesen
06/15/2010 - AutoIt - 4 Replies
Hallo!
Gibt es in AutoIt einen Befehl oder eine Function um den Dateispeicherort einer Datei rauszufinden? ich brauche den damit ich den BEfehl FileMove() verwenden kann.
mfg
|
Wie wird eine Java Datei über Webbrowser verschickt ?
06/01/2010 - General Coding - 0 Replies
Ich habe ein Spiel , das mit Java gemacht wurde und im Webbrowser gespielt wird . Ich habe bereits etwas die Packete gesnifft und wollte herausfinden wie und wo das Programm an meinen PC geschickt wird .
Nach ca 3h Suchen und Packetsanalyse (bin ja eig. kein Noob) , hatte ich immer noch nichts gefunden , wo ich hunderprozentig sagen konnte "Das muss das Programm sein" .
Deswegen ersteinmal eine ganz allgemeine Frage , wer empfängt die Datei ?
1. Der Browser direkt oder
2. Die Java Run...
|
All times are GMT +1. The time now is 14:13.
|
|