| Solution |
| 1. | Create New Task |
Click on New -> Task Editor. |
| 2. | Loop through each file in a folder |
Using the Loop command from the Conditions / Loops category, select "Each
file in a folder" option. Select a
source folder by clicking on the "Browse..." button. Screenshot 1
Start Loop " Each File in F:\SourceFolder"
End Loop |
| 3. | Check for the existence of the file in the destination folder |
Using the IF command from the Conditions/Loops category, select "File
does not exist" option from the IF interface. In the "Select File" textbox
specify "F:\DestinationFolder\$FileName$.$Extension$". Screenshot 2 Note:
"F:\DestinationFolder\": It is destination folder in which the current file is to be searched.
"$FileName$.$Extension$": $FileName$ and $Extension$ are system variables.
$FileName$ : Contain the name of the file currently referred in the loop without the extension.
$Extension$: Contain the extension of the file currently referred in the loop. |
| 4. | Copy the file from
the source folder, if the file does not exist in the destination folder |
Using the Files/Folders command from the Programs/Files/Windows
category, select "Copy File(s)" option from the Files /Folders interface. In the
"Source File(s) with Path" textbox specify, "F:\SourceFolder\$FileName$.$Extension$".
and in the "Destination Folder with path specify "F:\DestinationFolder\$FileName$.$Extension$"
Screenshot 3 Note:
"F:\SourceFolder\": It is the source folder referred in the loop, from which
the file has to be deleted. "F:\DestinationFolder\": It is the
destination folder, whose files are compared with the source folder. |
| 5. | Synchronize destination folder |
Repeat steps 2,3 and 4, for coping files from destination folder that are
not existing in source folder. Screenshot 4 |
| |
|
When you run this task, it loops trough all the files in the source folder
and checks if the file exist in the destination folder, if the file does not
exist in the destination folder then copies the file from the source folder to
the destination folder, and
vice-versa .
This task uses 'Copy Files' command to synchronize the two folders. You
can also use 'Delete Files' or 'Rename Files' commands based on your need to
synchronize the two folders |