-6

Using powershell you can take the distinct name of file of one folder and rename to the adjancent counterparts in another folder.

1 Answers1

0

This is a simple way of renameing all file of a 2nd folder to the files of the first folder. Make sure the files in each folder correspond to each order in correct order.

$dir = Get-ChildItem -Path "path to source folder with name you want to copy"
for ($i = 0 ; $i -le (Get-ChildItem -Path "destination folder where you are renaming" | Measure-Object).Count ; $i++) {
    Get-ChildItem -Path "destination folder where you are renaming" | 
    Select-Object -Index $i | 
    Rename-Item -NewName $dir[$i]
}
Itchydon
  • 2,572
  • 6
  • 19
  • 33
  • 5
    If you meant to share knowledge Q&A-style, I suggest editing the question to show a clearly formulated problem statement - not doing so probably triggered the down-votes (which I didn't contribute to). Also, please [format your post properly](https://stackoverflow.com/help/formatting). – mklement0 Dec 30 '20 at 22:59