Доброе время,
Werty666 Почти оффтопик - VBS скрипт. Пока не переименовывает, только выводит новые имена в output.txt возле себя. Нужен GetJPGInfo.vbs из набора
jpginf. [more]
Код: ' Uses GetJPGInfo.vbs from
http://www.jsware.net/jsware/scrfiles.php5#jpginf Set FSO = CreateObject("Scripting.FileSystemObject")
If Not FSO.FileExists ("GetJPGInfo.vbs") Then
MsgBox "GetJPGInfo.vbs not founded"
WSript.Quit
End If
If Wscript.Arguments.Count <> 3 Then
MsgBox "Lack of arguments. Usage - " & vbCrLf & "script.vbs ""Persone Name"" ""Persone Birthday"" ""Path to folder to process""" & vbCrLf & "Example" & vbCrLf & "script.vbs ""Ivanov Ivan"" ""12.04.1982"" ""D:\FOLDER\"""
WScript.Quit
End If
vPerName = Wscript.Arguments.Item(0)
vDate = DateValue(Wscript.Arguments.Item(1))
vFolder = Wscript.Arguments.Item(2)
If Not FSO.FolderExists(vFolder) Then
MsgBox vFolder & " not exist"
WScript.Quit
End If
Set objFolder = FSO.GetFolder(vFolder)
Set JpgInfoFile=FSO.openTextFile("GetJPGInfo.vbs")
vJpgInfoData = JpgInfoFile.ReadAll
vJpgInfoData = "'" & Mid (vJpgInfoData,Instr (vJpgInfoData,"START JPGInfo CLASS"))
executeGlobal vJpgInfoData
Set EI = new JPGInfo '-- Create JPGInfo object
Set OutFile = FSO.CreateTextFile("output.txt", 1)
For Each File in objFolder.Files
If LCase(Mid(File.Path,InStrRev(File.Path,"."))) = ".jpg" Then
Set ED1 = EI.GetExifData(File.Path)
FileDate = Left(ED1.Item(7),10)
FileDateParsed = DateValue(Mid(FileDate,9,2) & "." & Mid(FileDate,6,2) & "." & Left(FileDate,4))
AgeY = DateDiff ("yyyy",vDate,FileDateParsed)
AgeD = DateDiff ("d",vDate, DateAdd("yyyy", -AgeY, FileDateParsed))
NewName = Replace(FileDate,":","-") & " " & vPerName & " " & AgeY & " years " & AgeD & " days_" & File.Name
OutFile.WriteLine chr(34) & File.Path & """ """ & NewName & chr(34)
Set ED1 = Nothing
End If
Next