Skip to content

File_Sync

Synchronizes files and directories between two directories. After the synchronization, the target directory is a copy of the source directory.

File_Sync(sSourceDir, sTargetDir, iBandwithUtilization, aExcludedDirectories, aExcludedFiles) As Boolean

Directory that files should be synchronized from

Directory that files should be synchronized to

No longer supported. The value is ignored, but the parameter must still be passed, for example 100.

Names of directories that should be excluded, for example Array("Printers"). A directory with that name is skipped at any level.

Names of files that should be excluded, for example Array("tip.htm"). A file with that name is skipped in every directory.

  • The source directory must exist. If it doesn’t, the function returns False. The target directory is created if it doesn’t exist.
  • All attributes, such as read-only, are removed from the files and directories in the target before the synchronization.
  • A file is copied if it doesn’t exist in the target, or if its modified date differs from the file in the target.
  • Names in the exclusion lists are compared without regard to case. Wildcards aren’t supported.
Dim aExcludeDir, aExcludeFile
aExcludeDir = Array("Printers", "Wallpaper")
aExcludeFile = Array("tip.htm", "tips.gif", "bullet.gif")
If bStatus Then bStatus = File_Sync("C:\CapaInstaller", "C:\Web", 100, aExcludeDir, aExcludeFile)

Scripting Guidelines

File_CopyTree File_DelTree File_VerCopy Constants Package Property Variables