LATEST UPDATES
ShareHolder Finder v0.9.1 is now released!!! Check Product Page for more details.
✉ info@automationdevelopers.com

ITS ALL ABOUT AUTOMATION

Sunday, 9 October 2016

AutoIt - How to Move a Folder


Author Post Date Sunday, 9 October 2016
DirMove function is used to move a folder/ directory. It moves the directory with all the sub directories and files.

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

DirMove function returns 1 for success and 0 if there is an error moving the directory. If the source directory does not exist, the function returns 0.

Example:


#include <FileConstants.au3>
#include <MsgBoxConstants.au3>

;Move My Documents directory to <temp>\Backups\MyDocs and get the status.
$bStatus = DirMove(@MyDocumentsDir, @TempDir & "\Backups\MyDocs", $FC_OVERWRITE)

;Display status message.
If $bStatus Then
    MsgBox($MB_ICONINFORMATION, "Status", "Directory moved successfully.")
Else
    MsgBox($MB_ICONERROR, "Status", "Error moving the directory.")
EndIf

Related Posts





Interesting? Share and Let Others Know.

Post a Comment