I know it seems like this question has been asked a million times, but I think that my predicament is a little different and I can’t find anything that serves my purpose. If this has already been asked and I’ve just missed it somehow, please refer me to that question.
I have three files that need to be copied from one folder into another, where those files may already exist.
So for example C:\Program Files\file.dll needs to be moved to C:\Program Files (x86) where the file.dll may already exist. I also need the source files to stay in its directory.
I know the MOVE [source][destination] will move the files from the source which will delete them.
I’ve tried this :
set source=C:\Program Files\file.dll
set destination=C:\Program Files (x86)\
xcopy %source% %destination% /y
that I found here: How do I write a batch script that copies one directory to another, replaces old files?
but I get the message “invalid number of parameters”.
Am I missing something silly ? Is there a simple way of doing this? Even a hint in the right direction would be greatly appreciated!
If the paths have spaces in them you may need: