Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Copy and rename files

$
0
0
Hi folks,

Let me explain the situation. FolderA and FolderB had identical data (the same files and folders/subfolders structure) in them as they were in sync before. The sync between them has been broken and there is no way of knowing what got changed in FolderA and FolderB.

Now I want to get rid of FolderA. Before that I need a script that will copy data from FolderA to FolderB.
New files and folders need to be copied with no exception. However, it should compare file name and last modified date/time for existing files. If both are equal on both sides then skip copying. If file names are the same, but different date modified then copy and rename by adding date modified to the file name. It should not overwrite existing files/folders. Thank you for your help.

Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>