Need Xcopy command to copy and rename all the files


I need a 'Xcopy' or any copy command to copy a file from source to destination and rename the file.

for example

Source directory : C:\Source\

Files in Sourced irectory : textfile.txt ; xmlfile.xml; htmlfile.htm

Destination directory : C:\Destination\

Files in Destination directory: ;;

Best Solution

Assuming that you are using Windows Vista/7 or so,

copy C:\Source\*.* C:\Destination\*.*.tmp

The Destination folder has to exist, otherwise the copy will fail. It will not do the copy recursively, but in your example it works perfectly!