DirCopy

From AutoIt Wiki

Jump to: navigation, search

Copies the content of one directory and all sub-directories. Adapted from AutoIt docs.

Contents

[edit] Syntax

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

[edit] Parameters

sourcePath of source directory to be copied. e.g. "C:\Path1"
destinationPath of destination directory to be copied to. e.g. "C:\Path_Copy"
flagDetermines overwrite status.(Optional)


Note: Paths do not require trailing backslashes.

[edit] Flag

0   do not overwrite if already exists (default)
1   overwrite existing files

[edit] Return Value

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

If destination directory does not exist, it will be created.

[edit] Example

DirCopy(@MyDocumentsDir, "C:\Backups\MyDocs", 1)

[edit] Related Functions

DirRemove FileCopy DirCreate DirMove DirGetSize

Personal tools