Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsFileCopyMBS class.

Previous items

WindowsFileCopyMBS.FileOperationMove(source() as string, dest() as string, Flags as Integer, ProgressTitle as string="") as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 9.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Move the files specified in the source parameter to the location specified in the dest parameter.

This method has several varations so you can call it with a folderitem or a string to specify a file or folder. You can also pass an array of folderitems or strings to delete several files/folders in one operation.

source:
These names should be fully-qualified paths to prevent unexpected results.
Standard Microsoft MS-DOS wildcard characters, such as "*", are permitted only in the file-name position. Using a wildcard character elsewhere in the string will lead to unpredictable results.

dest:
The destination file or directory name. Wildcard characters are not allowed. Their use will lead to unpredictable results.

Copy and Move operations can specify destination directories that do not exist. In those cases, the system attempts to create them and normally displays a dialog box to ask the user if they want to create the new directory. To suppress this dialog box and have the directories created silently, set the FileOperationNoConfirmationMkDir flag in Flags.
For Copy and Move operations, the buffer can contain multiple destination file names if the fFlags member specifies FileOperationMultiDestFiles.
Use fully-qualified paths. Using relative paths is not prohibited, but can have unpredictable results.

Use the FileOperation* constants for the flags.
If a dialog is displayed, the window used in the parent property is used for the parent window.
If ProgressTitle is not empty, this string is used to specify the progress window title text.

Returns true on success and false on failure.

See also:

WindowsFileCopyMBS.MoveFileSimple(ExistingFileName as folderitem, NewFileName as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 9.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Moves an existing file or a directory, including its children.

ExistingFileName:The current name of the file or directory on the local computer.

NewFileName: The new name for the file or directory. The new name must not already exist. A new file may be on a different file system or drive. A new directory must be on the same drive.

Returns true on success and false on failure.

The MoveFile function will move (rename) either a file or a directory (including its children) either in the same directory or across directories. The one caveat is that the MoveFile function will fail on directory moves when the destination is on a different volume.

If a file is moved across volumes, MoveFile does not move the security descriptor with the file. The file will be assigned the default security descriptor in the destination directory.

The MoveFile function coordinates its operation with the link tracking service, so link sources can be tracked as they are moved.

See also:

WindowsFileCopyMBS.MoveFileSimple(ExistingFileName as String, NewFileName as String) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 9.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Moves an existing file or a directory, including its children.

ExistingFileName:The current name of the file or directory on the local computer.

NewFileName: The new name for the file or directory. The new name must not already exist. A new file may be on a different file system or drive. A new directory must be on the same drive.

Returns true on success and false on failure.

The MoveFile function will move (rename) either a file or a directory (including its children) either in the same directory or across directories. The one caveat is that the MoveFile function will fail on directory moves when the destination is on a different volume.

If a file is moved across volumes, MoveFile does not move the security descriptor with the file. The file will be assigned the default security descriptor in the destination directory.

The MoveFile function coordinates its operation with the link tracking service, so link sources can be tracked as they are moved.

See also:

WindowsFileCopyMBS.MoveFileWithProgress(ExistingFileName as folderitem, NewFileName as folderitem, Flags as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 9.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Moves a file or directory, including its children.

ExistingFileName: The name of the existing file or directory on the local computer.

If Flags specifies MOVEFILE_DELAY_UNTIL_REBOOT, the file cannot exist on a remote share because delayed operations are performed before the network is available.

NewFileName: The new name of the file or directory on the local computer.

When moving a file, NewFileName can be on a different file system or volume. If NewFileName is on another drive, you must set the MOVEFILE_COPY_ALLOWED flag in Flags.

When moving a directory, ExistingFileName and NewFileName must be on the same drive.

If Flags specifies MOVEFILE_DELAY_UNTIL_REBOOT and NewFileName is nil, MoveFileWithProgress registers ExistingFileName to be deleted when the system restarts. The function fails if it cannot access the registry to store the information about the delete operation. If ExistingFileName refers to a directory, the system removes the directory at restart only if the directory is empty.

Flags: The move options. This parameter can be one or more of the following values: MoveFileCopyAllowed, MoveFileReplaceExisting, MoveFileCreateHardLink, MoveFileDelayUntilReboot and MoveFileWriteThrough.

Return Value: If the function succeeds, the return value is true. If the function fails, the return value is false.

When moving a file across volumes, if the Progress event returns PROGRESS_CANCEL due to the user canceling the operation, MoveFileWithProgress will return zero and GetLastError will return ERROR_REQUEST_ABORTED. The existing file is left intact.

When moving a file across volumes, if the Progress event returns PROGRESS_STOP due to the user stopping the operation, MoveFileWithProgress will return zero and GetLastError will return ERROR_REQUEST_ABORTED. The existing file is left intact.

See also:

WindowsFileCopyMBS.MoveFileWithProgress(ExistingFileName as String, NewFileName as String, Flags as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 9.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Moves a file or directory, including its children.

ExistingFileName: The name of the existing file or directory on the local computer.

If Flags specifies MOVEFILE_DELAY_UNTIL_REBOOT, the file cannot exist on a remote share because delayed operations are performed before the network is available.

NewFileName: The new name of the file or directory on the local computer.

When moving a file, NewFileName can be on a different file system or volume. If NewFileName is on another drive, you must set the MOVEFILE_COPY_ALLOWED flag in Flags.

When moving a directory, ExistingFileName and NewFileName must be on the same drive.

If Flags specifies MOVEFILE_DELAY_UNTIL_REBOOT and NewFileName is "", MoveFileWithProgress registers ExistingFileName to be deleted when the system restarts. The function fails if it cannot access the registry to store the information about the delete operation. If ExistingFileName refers to a directory, the system removes the directory at restart only if the directory is empty.

Flags: The move options. This parameter can be one or more of the following values: MoveFileCopyAllowed, MoveFileReplaceExisting, MoveFileCreateHardLink, MoveFileDelayUntilReboot and MoveFileWriteThrough.

Return Value: If the function succeeds, the return value is true. If the function fails, the return value is false.

When moving a file across volumes, if the Progress event returns PROGRESS_CANCEL due to the user canceling the operation, MoveFileWithProgress will return zero and GetLastError will return ERROR_REQUEST_ABORTED. The existing file is left intact.

When moving a file across volumes, if the Progress event returns PROGRESS_STOP due to the user stopping the operation, MoveFileWithProgress will return zero and GetLastError will return ERROR_REQUEST_ABORTED. The existing file is left intact.

See also:

Previous items

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...