05-06 years of writing things, put it up, do a backup bar, now look at that time to write code, still very normative.
Now, I would definitely write in JavaScript or Python.
Option Explicit '------------------------------------------------------------Description: For synchronizing directories and files in two directories '---------------
---------------------------------------------' const Strfoldera = "G:\Downloads\Soft" ' Const STRFOLDERB = ' K:\Soft ' Const STRFOLDERB = "G:\Downloads\Soft" Const Strfoldera = "K:\Soft" Dim fsoobj Set fsoobj = CreateObject ("Scripting.files Ystemobject ") If not Fsoobj.folderexists (Strfoldera) Then MsgBox (" Source Directory & Strfoldera & "does not exist. ") Else If not fsoobj.folderexists (strfolderb) Then Fsoobj.createfolder (strfolderb) Synchronize Strfoldera, Strfolderb E nd If Set fsoobj = Nothing MsgBox ("Congratulations, sync success.") '------------------------------------------------------------' Description: Sync two folders ' parameters: ' sfoldera directory name ' Sfolderb Directory name ' return: No '------------------------------------------------------------Sub Synchronize (Sfoldera, Sfolderb) Dim Fsofoldera,fsofolderb Dim Fsosubfoldera, Fsosubfolderb Dim itmfoldera,itmfolderb Dim Fsofilea,fsofileb Dim ItmFileA,it Mfileb Dim BlnfileinfOlderb Dim blnfolderinfolderb Set fsofoldera = Fsoobj.getfolder (sfoldera) Set fsofolderb = Fsoobj.getfolder (SFolderB) Set Fsofilea = Fsofoldera.files Set Fsofileb = Fsofolderb.files for all Itmfilea in Fsofilea Blnfileinfolderb = Fal
Se for each itmfileb in Fsofileb If itmfilea.name = Itmfileb.name and _ Itmfilea.size = Itmfileb.size and _ itmfilea.datelastmodified = itmfileb.datelastmodified Then blnfileinfolderb = True Exit for end If Nex T If not blnfileinfolderb Then itmfilea.copy fsofolderb.path & "\" & Itmfilea.name, True End If Next Set Fsofilea = Nothing Set Fsofileb = Nothing Set Fsosubfoldera = fsofoldera.subfolders Set Fsosubfolderb = fsofolderb.su Bfolders for each itmfoldera in Fsosubfoldera Blnfolderinfolderb = False for each itmfolderb in Fsosubfolderb If i Tmfoldera.name = itmfolderb.name Then blnfolderinfolderb = True Exit for-if Next if not blnfolderinfold ErB Then Fsoobj.creatEFolder (Fsofolderb.path & "\" & itmfoldera.name) End If Synchronize Itmfoldera.path, Replace (itmfoldera.path,s Trfoldera,strfolderb) Next Set Fsosubfoldera = Nothing Set Fsosubfolderb = no set Fsofoldera = Nothing Set fsof
Olderb = Nothing End Sub