DirMove

From AutoIt Wiki

Jump to: navigation, search

Moves a directory and all sub-directories and their content. May be used as a renaming mechanism. Adapted from AutoIt docs.

Contents

[edit] Syntax

DirMove("source","destination" [,flag])

[edit] Parameters

sourcePath of the source directory. e.g. "C:\Path1"
destinationPath to be moved to. e.g. "C:\Path2"
flagdetermines overwrite characteristic.(Optional)

Note: Paths do not require trailing backslashes.

[edit] Flag

0   no overwrite
1   overwrite existing

[edit] Return Value

Success: Returns 1.
Failure: Returns 0 if an error occurs.

[edit] Remarks

If the source and destination are on different volumes or UNC paths are used, then a copy/delete operation will be performed. If the destination already exists and the overwrite flag is specified then the source directory will be moved into the destination.

[edit] Example

DirMove(@MyDocumentsDir, "C:\Backups\MyDocs")

[edit] Related Functions

DirCreate DirGetSize FileMove DirRemove

Personal tools