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.
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
#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
- AutoIt - How to Create a Folder
- AutoIt - How to Copy a Folder
- AutoIt - How to Rename a Folder
- AutoIt - How to Delete a Folder
Interesting? Share and Let Others Know.
Post a Comment