Call Toll Free: 1-888-484-3535    

  Automation Anywhere - The Automation Software

Sample Tasks -> T37 - Synchronize folders

Task Description: Synchronize two folders.

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

Screenshot 1:

Screenshot 2:

Screenshot 3:

Screenshot 4:

E-Mail: Enter your email address to receive information about new products & offers from Tethys Solutions.


 PRODUCTS

 Automation Anywhere
   Standard & Premier
   Enterprise
 Workspace Macro Pro
 Workspace Macro
 Launch-n-Go
 Free Downloads
 Compare Products
 

 SOLUTIONS FOR

 Home & Home Office
 Business & IT
 Partners
 Developers
 

 SERVICES

 Ask The Expert
 Consulting Service
 

 PURCHASE

 BUY NOW
 Pricing
 Upgrades
 Our Guarantee

 SUPPORT

 FAQ & Examples
 Have a Question?
 Open A Support Case
 Forums
 

 QUICK LINKS

 Productivity Essentials
 Pre-defined Templates
 

 GENERAL

 Tell A Friend, Win a CD
 Affiliates
 Articles: Macro &
 Automation

 Get RSS Feeds

 Press & News
 Contact Us
Home |Site Map |Privacy Policy |About Us |Contact Us

Copyright © 2003-2008 Tethys Solutions, LLC. All rights reserved. Trademarks