Archive: Copy an existing folder to a new location


Copy an existing folder to a new location
  I need my installer to move an existing folder on the target system to a new location on the same system. All contents including subfolders must be moved.

I believe I could do:

ExecWait '"XCOPY" "Source-Folder" "Dest-Folder" /e /i /y' 

But is there an built in command I can put in my installer to do the same thing?

Simple think would be CopyFile.


CopyFiles /SILENT "SourceDir\*.*" "DestDir\"
RMDir /r "SourceDir"

Thank you...it is exactly what I needed. Here is a snippet of code that I am using:

ClearErrors

>${If} ${FileExists} "$0\*.*" ;Folder $0 exists
CreateDirectory $INSTDIR
CopyFiles/SILENT "$0\*.*" "$INSTDIR"
RMDir /r $0
>${Else} ;Folder $0 does not exist
;-----
${Endif}

If you are going to delete the original folder, why not use Rename? Rename can move folders.

Stu