Bonjour,
Le code que je vous propose ne répond pas vraiment à votre question mais il permet de récupérer un bon nombre d'informations sur un fichier.
Je l'utilise principalement sur des vidéos ou des images mais il fonctionne sur tout type de fichier, y compris des EXE.
La première fonction renvoie une information ex: _FileGetDetails($File,27) qui est la longueur
La deuxième fonction renvoie tout (186 infos en fonction du fichier)
Code : Tout sélectionner
$File = FileOpenDialog("",@DesktopDir,"all(*.*)")
;MsgBox(0,"",$File)
;_FileGetDetails($File,27)
_FileGetDetailsAll($File)
Func _FileGetDetails($File, $Prop = 0)
Dim $arrHeaders[35]
$objShell = ObjCreate("Shell.Application")
$Path = StringLeft($File, StringInStr($File, "\", 0, -1) -1)
$fName = StringMid($File, StringInStr($File, "\", 0, -1) +1)
$objFolder = $objShell.Namespace($Path)
For $i = 0 to 34
$arrHeaders[$i] = $objFolder.GetDetailsOf($objFolder.Items, $i)
Next
For $Filename In $objFolder.Items
If $objFolder.GetDetailsOf($Filename, 0) = $fName Then
MsgBox(0, $objFolder.GetDetailsOf($Filename, 0), $arrHeaders[$Prop] & " : " & $objFolder.GetDetailsOf($Filename, $Prop))
ExitLoop
EndIf
Next
EndFunc;<==> _FileGetDetails($File)
Func _FileGetDetailsAll($File);; $File is the Full path and file name if the file to check.GEOSoft
$objShell = ObjCreate("Shell.Application")
$Path = StringLeft($File, StringInStr($File, "\", 0, -1) -1)
$fName = StringMid($File, StringInStr($File, "\", 0, -1) +1)
$objFolder = $objShell.Namespace($Path)
$objVerbs = $objFolder.Self.Verbs
Local $dt, $dt1
For $Filename In $objFolder.Items
For $i = 0 To 287
If $objFolder.GetDetailsOf($Filename, 0) = $fName Then $dt &= $i & " " & $objFolder.GetDetailsOf(Null, $i) &" >>> "& $objFolder.GetDetailsOf($Filename, $i) & @CRLF
Next
Next
FileDelete(@ScriptDir & "\objFolder.txt")
FileWrite(@ScriptDir & "\objFolder.txt",$dt)
ShellExecute(@ScriptDir & "\objFolder.txt")
EndFunc ;<==> _FileGetDetailsAll($File)
Un exemple d'info sur une photo
0 Nom >>> 20180630_220427.jpg
1 Taille >>> 7,79 Mo
2 Type d’élément >>> IrfanView JPG File
3 Modifié le >>> 03/07/2018 16:13
4 Date de création >>> 03/07/2018 16:13
5 Date d’accès >>> 04/07/2018 14:20
6 Attributs >>> A
7 État hors connexion >>>
8 Hors connexion >>>
9 Type identifié >>> Image
10 Propriétaire >>> PC
11 Sorte >>> Images
12 Prise de vue >>> 30/06/2018 22:04
13 Artistes ayant participé >>>
14 Album >>>
15 Année >>>
16 Genre >>>
17 Chefs d’orchestre >>>
18 Mots-clés >>>
19 Notation >>> Non classé
20 Auteurs >>>
21 Titre >>>
22 Objet >>>
23 Catégories >>>
24 Commentaires >>>
25 Copyright >>>
26 N° >>>
27 Longueur >>>
28 Vitesse de transmission >>>
29 Protégé >>>
30 Modèle d'appareil photo >>> SM-G930F
31 Dimensions >>> 4032 x 3024
32 Appareil photo >>> samsung
Etc....