Method: Move for File
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: Move for File
Method: Move for File
Moves a file to another folder.
Object.Move(Destination)
| Object | File Object with this method |
| Destination | String Specifies the path of the target folder to which DIAdem moves the source file. The path of the target folder must not contain wildcards. |
![]() | Note The Move method aborts as soon as the first error occurs. DIAdem does not undo changes made to the file system before an error occurred. |
The following example moves all files of a folder:
Sub MoveFiles(sSource,sTarget) Dim fso, oMyFolder, oMyFiles, oMyFile Set fso = CreateObject("Scripting.FileSystemObject") set oMyFolder = fso.GetFolder(sSource) set oMyFiles = oMyFolder.Files For Each oMyFile in oMyFiles Call oMyFile.Move(sTarget) Next End Sub
