DIAdem Help

Method: Move for File

  • Updated2024-09-12
  • 1 minute(s) read

Method: Move for File

Moves a file to another folder.

Object.Move(Destination)
ObjectFile
Object with this method
DestinationString
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

Log in to get a better experience