This is an adaptation of a script I posted earlier this morning - should hopefully do what you need?
Code:
SetFormat, Integer, hex ; so that the return value of the function is a hex value to match MSDN
SourceFolder := "C:\source" ; change this to your default source folder
while (!DestFolder)
FileSelectFolder, DestFolder, *C:\destination,,Please select distination folder ; change this to be a sensible place
; for default top-level destination.
SourceFolder := RegExReplace(SourceFolder, "\\$") . "\*" ; Removes the trailing backslashes, if present. The * means
DestFolder := RegExReplace(DestFolder, "\\$") ; copy everything in the source folder
VarSetCapacity(SHFILEOP, 30, 0) ; set up SHFILEOPSTRUCT
NumPut(1, SHFILEOP, 4) ; wFunc = FO_MOVE
NumPut(&SourceFolder, SHFILEOP, 8) ; pFrom
NumPut(&DestFolder, SHFILEOP, 12) ; pTo
NumPut(3612, SHFILEOP, 16) ; fFlags (FOF_SILENT + FOF_NOCONFIRMATION + FOF_NOCONFIRMMKDIR
; + FOF_NOCOPYSECURITYATTRIBS + FOF_NOERRORUI + FOF_RENAMEONCOLLISION = 3612)
; This will not show any progress or any errors while moving the files, but will automatically rename files on
; collision (i.e. if file already exists) to "Copy of <filename>"
If ( Result := DllCall("shell32.dll\SHFileOperation", "Int", &SHFILEOP) )
{
MsgBox, % "An error occurred moving the files. Return Value was """ . Result
. """.`n`nPlease see the error codes at the following link for the meaning of this:"
. "`nhttp://msdn.microsoft.com/en-us/library/bb762164%28VS.85%29.aspx"
}
Else
MsgBox, % "Files should have been moved successfully and inherited the destination folder's permissions."
Return
[Edit: This thread should probably be in the Help forum, not here]
[Edit: thanks jaco]