There was an idea to use sfk, but there are also partial problems with it.
I made .vbs with checking the version, modification date and size if the date matches:
Code: Select all
'——————————————————————————— VBS ———————————————————————————
' Purpose: Update files in the folder tree of the
' target panel with the selected same-name files
' Parameters: %WL "%T"
' Source URL: http://ghisler.ch/board/viewtopic.php?p=445730
'————————————————————————————————————— Author: Flasher © ———
Option Explicit
Dim A, C, oFSO, oDic, oRgx, List, F, V, TPath, Once
Set A = WSH.Arguments: C = A.Count: If C = 0 Then WSH.Quit
If C <> 2 Then MsgBox "Specify 2 parameters!", 262192: WSH.Quit
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oDic = CreateObject("Scripting.Dictionary")
Set List = oFSO.OpenTextFile(A(0),,,-1)
Set oRgx = New RegExp: oRgx.Global = 1
oRgx.Pattern = "\d*?(\d{1,5}\b)"
Do: F = "\\.\" & List.ReadLine
If Right(F, 1) <> "\" Then
V = oFSO.GetFileVersion(F)
If V <> "" Then V = "|" & Ver(V)
With oFSO.GetFile(F)
oDic.Add F & "|" & .Size, .DateLastModified & V
End With
End If
Loop Until List.AtEndOfStream: List.Close
If Len(A(1)) > 3 Then TPath = "\\.\" & A(1): Once = 1 Else TPath = A(1)
On Error Resume Next: Recursion oFSO.GetFolder(TPath)
CreateObject("WScript.Shell").Popup " Done!", 1,_
" Update files in the folder tree ", 4160
Set List = Nothing: Set oFSO = Nothing: Set oDic = Nothing
Sub Recursion(oDir)
Dim K, F2, Check, oFile, FDate, TDate, D
If IsEmpty(Once) Then If Len(oDir.Path) > 3 Then _
Set oDir = oFSO.GetFolder("\\.\" & oDir.Path): Once = 1
For Each K in oDic
F = Split(K, "|")
TPath = oFSO.BuildPath(oDir.Path, "\")
F2 = TPath & oFSO.GetFileName(F(0))
If oFSO.FileExists(F2) Then
Check = 0
If InStr(oDic(K), "|") Then
Check = StrComp(Split(oDic(K), "|")(1), Ver(oFSO.GetFileVersion(F2)), 1)
If Check = 1 Then oFSO.CopyFile F(0), TPath, 1
End If
If Check = 0 Then
Set oFile = oFSO.GetFile(F2)
FDate = oFile.DateLastModified
TDate = CDate(Split(oDic(K), "|")(0))
If TDate > FDate Then
oFSO.CopyFile F(0), TPath, 1
ElseIf TDate = FDate Then
If F(1) <> oFile.Size Then _
oFSO.CopyFile F(0), TPath, 1
End If
End If
End If
Next
For Each D in oDir.SubFolders: Recursion D: Next
End Sub
Function Ver(V)
Ver = Mid(oRgx.Replace(Replace("." & V, ".", ".0000"), "$1"), 2)
End Function