First step is to delete all folders of Size 0
Recursion is your friend
Declare objFSO at module level, so the same FSO can be used by all recursions. Set obFSO in the main sub. In the main sub, call the Function described below, passing the root Folder
Build a Function that will take one Folder, IF it's size is 0 then
Delete it
exit Function.
Declare all needed Variables, Except obFSO, inside the function.
Else create a list of sub folders,
for each subfolder, call itself, passing the subfolder
Next SubFolder
End IF
End Function
That is a nice simple recursive function that should run thru 500 subfolders in 1 or 2 minutes while being a good example of recursiveness,
As for moving files: At first thought, I would use a Module level Dictionary to keep a list of files that are where they should be, A recursive function can use an outside non recursive function to manipulate the Dictionary for each File. The Dictionary can keep the LastModifiedDate as an Item so you can keep the latest file.Actually, I would use 2 outside functions, 1 to check the dictionary (Delete file if True) and 1 to update it (Continue if True). Both should return Booleans