BestSync Icon BestSync Help Home / Main Index / Task Wizard

Task Wizard: Application

Application to run before synchronization:

Specify an application or a batch file to run before the synchronization, leave it to be empty if it is not necessary. If there arguments, input them in the "arguments" edit box.

*Special samples for running .bat file:

To specify a .bat file without argument, set like this:

Application file:

[c:\testpath\test.bat]

Arguments:

[ ]

To specify a .bat file with argument, set like this:

Application file:

[c:\testpath\test.bat]

Arguments:

[Argument1 Argument2]

*Special samples for running Powershell Script:

To specify a .ps1file without argument, set like this:

Application file:

[c:\testpath\test.ps1]

Arguments:

[ ]

To specify a .ps1file with argument, set like this:

Application file:

[c:\testpath\test.ps1]

Arguments:

[Argument1 Argument2]

*Following predefine fields can be used to generate date-time string in the Argument:

<date:Date Format String> Formatted date string in English Locale.
<DATE:Date Format String> Formatted data string in User's Locale.
<time:Time Format String> Formatted time string in English Locale.
<TIME:Time Format String> Formatted time string in User's Locale.

For example, to get the data time string:
20100520-1832

You can use the following format string:
<date:yyyyMMdd>-<time:HHmm>

If the synchronization must be started after the end of the specified application, please check the " Wait until end of the application to start synchronization. " checkbox.

If you needs to run the application after the scanning and only when there are files need to be synchronized, please check the " Run the application only when there are files need to be synchronized after scanning " check box. The application will not be executed if there are no files to be synchronized.

Application or Sync Task to run after synchronization:

Specify an application or Sync Tasks to run after the synchronization, leave it to be empty if it is not necessary.

(1) To run an application or a batch file after synchronization:

Specify the a program file or bat file in the "Application file" edit box.
If the program needs arguments, specify the arguments in the "Arguments" edit box:

(2) To run Sync tasks after synchronization:

Check the "Sync Task ID" radio button, Input the one or multiple TaskIDs need to be run after this task.
The TaskID is set in the "General" wizard page.
Separate multiple tasks by comma (",") like following:
  [TaskID1,TaskID2,....,TaskIDn]
For example,
  [1,2,4]

If this task is started by the preview window, the tasks set here will be started by preview windows also. If this task is ran as a window service, the tasks set here must also be set to run as windows service.

(3) Start HTTP request or POST data to an URL:

Specify the URL in the "Application file" edit box.
URL sample:
  https://user:password@server.com/object/
user:password is the user account if necessary. If the task synchronizes with a WebDAV server, you can skip the account, BestSync will use the account of the WebDAV server.
If you want to post data to the server, you can specify a file path contains the data in the "Arguments" edit box.

(4) Condition for starting application or URL

*: Start application or URL only when some files of Folder1 have been changed.

Add <= at the begin of the application or URL.

For example:

  <=c:\App\App.exe

*: Start application or URL only when some files of Folder2 have been changed.

Add => at the begin of the application or URL.

For example:

  =>https://server.com/test/url.html

Add-on DLL File

Specify an add-on DLL file.
The Addon DLL export a API like following:
DWORD WINAPI AddOnInterface(BESTSYNC_ADDON* pAddOn);
A sample DLL source code called AddOnDllSrc.zip is installed in the application folder.
For the details of the add-on DLL, please refer to the comment in the source code.
BestSync calls the API before and/or after a file is copied.

BestSync Icon BestSync Help Home / Main Index / Task Wizard