I am trying to copy files from one directory to another and if there is a file with that duplicate name save the file. Basically the copy but keep both files option in windows. How can i accomplish this from the windows command line?
I need a way to do this from one command prompt session
Directory path 1: "C:\Users\User 1" Directory path 2: "C:\Users\User 2"
You can find scripts from a quick google that you could drop into a bat file and handle this but I would like to propose you look into powershell to handle this problem.
You could call powershell from the command line if you wanted to so this answer technically fits the requirement. Powershell will make these kinds of tasks easier and give you more flexibility if you want to make any other changes to the copy operation.
How to Copy Individual Files and Rename Duplicates with Powershell