Global n As Integer
Sub DateiInformationen_auslesen()
n = 1
PFAD = InputBox("Startverzeichnis")
With ThisWorkbook.Worksheets(1)
Call list_files(CreateObject("Scripting.FileSystemObject").GetFolder(PFAD))
End With
End Sub
Sub list_files(ordner As Variant)
Dim file As Variant
Dim subordner As Variant
Dim imMgk As Object
Set imMgk = CreateObject("ImageMagickObject.MagickImage.1")
iseadir = InStr(CStr(ordner), CStr("@eaDir"))
If iseadir = 0 Then
MkDir (ordner.Path & "\@eaDir")
End If
For Each file In ordner.Files
thumbnail = InStr(CStr(file.Name), CStr("SYNOPHOTO_THUMB"))
If thumbnail = 0 Then
MkDir (ordner & "\@eaDir\" & file.Name)
Open file For Binary Access Read Lock Write As #1
' x = Shell("C:\WINDOWS\system32\convert.exe " & file.Name & " -resize 1280x960 " & ordner & "\@eaDir\" & file.Name & "\SYNOPHOTO_THUMB_XL.jpg", vbNormalFocus)
imMgk.Convert CStr(file), "-resize", "1280x960", ordner & "\@eaDir\" & CStr(file.Name) & "\SYNOPHOTO_THUMB_XL.jpg"
imMgk.Convert CStr(file), "-resize", "800x600", ordner & "\@eaDir\" & CStr(file.Name) & "\SYNOPHOTO_THUMB_L.jpg"
imMgk.Convert CStr(file), "-resize", "320x240", ordner & "\@eaDir\" & CStr(file.Name) & "\SYNOPHOTO_THUMB_M.jpg"
imMgk.Convert CStr(file), "-resize", "120x90", ordner & "\@eaDir\" & CStr(file.Name) & "\SYNOPHOTO_THUMB_S.jpg"
Close #1
' Cells(n, 1) = file.Name
' Cells(n, 2) = ordner.Path
' n = n + 1
Else
End If
Next
For Each subordner In ordner.SubFolders
If (subordner.Attributes And 4) = 0 Then '/System-Ordner/
'hier sollte man den Ordner erstellen
Call list_files(subordner)
End If
Next
End Sub
Sub ElapsedTime()
'Timer zum Messen...
Dim StartTime As Double, EndTime As Double
StartTime = Timer
Call DateiInformationen_auslesen
EndTime = Timer
MsgBox CStr(EndTime - StartTime)
End Sub