Function Reference


DirMove

Moves a directory and all sub-directories and files.

DirMove ( "source dir", "dest dir" [, flag = 0] )

Parameters

source dir Path of the source directory (with no trailing backslash). e.g. "C:\Path1"
dest dir Path of the destination dir (with no trailing backslash). e.g. "C:\Path_Copy"
flag [optional] this flag determines whether to overwrite files if they already exist:
    $FC_NOOVERWRITE (0) = (default) do not overwrite existing files
    $FC_OVERWRITE (1) = overwrite existing files

Constants are defined in FileConstants.au3.

Return Value

Success: 1.
Failure: 0 if there is an error moving the directory.

Remarks

If the source and destination are on different volumes or UNC paths are used then a copy/delete operation will be performed rather than a move.

If the destination already exists and the overwrite flag is specified then the source directory will be moved inside the destination.

AutoIt does not have a "DirRename" function as you can use this function to rename a folder using "Full_Path\Old_Name" and "Full_Path\New_Name" as the "source dir" and dest dir" parameters.

Related

DirRemove, FileMove

Example

DirMove(@MyDocumentsDir, @TempDir & "\Backups\MyDocs")