Search code examples
windowscopyrenamemovexcopy

XCOPY and RENAME batch file?


I need to move a directory recursively to a new location, and rename the directory. Do I just use XCOPY to move the directory, then run the RENAME command on it (or vice versa) or is there a better way?


Solution

  • Try xcopy /E sourcefolder destinationfolder\newname\. If the folder "newname" does not exist yet, the trailing backslash suppresses the question whether you mean a file a directory. Answering file is not what you want.