Synchronizing Folders To Convert Only New Files in Watch Folder


By using the Watch Folder service and a batch file, you are able to synchronize your folders so that only new files placed in a Master folder are converted.

How to Synchronize the Folders to Convert Only New Files

  1. Stop Watch Folder Service. (Start – Programs – Document Conversion Service 3.0 – Watch Folder – Stop Watch Folder Service)
  2. Open Watch Folder configuration file. (Start – Programs – Document Conversion Service 3.0 – Watch Folder – Configure Watch Folder Settings)
  3. Scroll down to the WatchFolder section you are using. This example, we are modifying the ConvertToTIFF section.
  4. Change <add Name=”UseTimeDateSubFoldersInCompletedFolder …” to FALSE
  5. Make sure there is a path for the Completed folder (ie <add Name=”CompletedFolder” Value=”C:\PEERNET\Completed”/> )
  6. Save the Watch Folder configuration file.
  7. Start the Watch Folder Service. (Start – Programs – Document Conversion Service 3.0 – Watch Folder – Start Watch Folder Service)
    <WatchFolder Name="ConvertToTIFF Watch Folder">
      <Settings>
        <!-- Folder options -->
        <add Name="InputFolder" Value="C:\PEERNET\Input"/>
        <add Name="SearchFilter" Value="*.*"/>
        <add Name="IncludeSubFolders" Value="True"/>
        <add Name="DeleteInputSubFolders" Value="True"/>
        <add Name="StagingFolder" Value="C:\PEERNET\WatchFolders\ConvertToTIFF\Staging"/>
        <add Name="WorkingFolder" Value="C:\PEERNET\WatchFolders\ConvertToTIFF\Working"/>
        <add Name="FailedFolder" Value="C:\PEERNET\WatchFolders\ConvertToTIFF\Failed"/>
        <add Name="CompletedFolder" Value="C:\PEERNET\Completed"/>
        <add Name="OutputFolder" Value="C:\PEERNET\WatchFolders\ConvertToTIFF\Output"/>
        <add Name="PollingInterval" Value="15000"/>
        <add Name="DCOMComputerName" Value="localhost"/>
        <add Name="TestMode" Value="false"/>
        <add Name="NormalizeFilenames" Value="false"/>
        <add Name="CopyInstructionsFromResources" Value="ReadMe_ConvertToTIFF"/>
    
        <!-- 0 means no limit -->
        <add Name="Polling.MaxFilesToProcessAtATime" Value="0" />
        <add Name="Polling.SynchronousFilePickup" Value="false" />
        <add Name="UseTimeDateSubFoldersInCompletedFolder" Value="false" />
        <add Name="UseTimeDateSubFoldersInFailedFolder" Value="true" />
    
  8. Now create a file called Upload.bat and add these lines:

    @echo off
    for /f %%a in ('xcopy "C:\Input\*.*" "C:\PEERNET\Completed" /L /Y') do (
     if not exist "C:\PEERNET\Completed.\%%~nxa" xcopy "%%a" "C:\PEERNET\Input" /Y
    )
    
  9. Edit Upload.bat to change:
    • “C:\Input” to the Master folder where your new files are saved
    • “C:\PEERNET\Completed” to the Completed folder in your Watch Folder configuration file
    • “C:\PEERNET\Input” to the Input folder in your Watch Folder configuration file
  10. You can either manually run Upload.bat to copy any new files since the last conversion to the Input folder or you can set Upload.bat in a scheduled task that runs periodically, so that the checking is done automatically throughout the day.