Method: MoveFile for FileSystemObject
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: MoveFile for FileSystemObject
Method: MoveFile for FileSystemObject
Moves one or more files.
Object.MoveFile(Source, Destination)
| Object | FileSystemObject Object with this method |
| Source | String Specifies the path of the files that you want to move. The path may contain wildcards in the last path component. If the source contains wildcards, the target path must lead to an existing folder. |
| Destination | String Specifies the path of the target folder to which DIAdem copies the source file. The path of the target folder must not contain wildcards. |
![]() | Note The MoveFile 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 TDR files from C:\Examples\Documents folder to the C:\Temp folder:
Sub MoveFiles(sSource,sTarget) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Call fso.MoveFile(sSource,sTarget) End Sub Call MoveFiles("C:\Examples\Documents\*.tdr", "c:\Temp")
