Visual Basic Scripts
This profile property enables you to run Visual Basic Scripts before and after a copy operation. This option is available from the AllSync Professional Edition.VBScripts
Startup Mode
- Upon Profile Startup
- Upon Profile Completion
Start With
This option enables you to specify the operation during which the script is to be started:- Copy Operation
- Copy Preview
- Process Copy Preview
- Scheduler
- Command Line
Wait Time
This option enables you to specify that the script be automatically aborted after a certain number of seconds.Requirements and Tips
- Visual Basic scripts can't be used with AllSync unless Microsoft Windows Scripting Host is installed on your computer. You can check this by running the sample script
Test.vbs
. - The properties and methods of the WScript object have to be called without "WScript." Example: Instead of
WScript.CreateObject
onlyCreateObject
has to be used. - Some properties and methods of the WScript object, e.g.
Sleep
orEcho
, cannot be used in the script or possess limited functionality. - The error value -99 causes the profile to be aborted and no error message will be generated. See sample script
CheckDestinationDrive.vbs
. You also can use a variable with the nameExitCode
and set the value to-99
.
Placeholders
The following placeholders can be used inside the script:Placeholder | Description |
---|---|
[SourceX] | [Source1] is replaced by the first source folder activated in the source folder list, [Source2] by the second one, etc. |
[DestinationX] | [Destination1] is replaced by the first destination folder activated in the destination folder list, [Destination2] by the second one, etc. |
[Profil] | Profile name |
[ErrorCount] | Error count |
[CopyToSource] | The amount of data in bytes to be copied from the destination to the source |
[CopyToDestination] | The amount of data in bytes to be copied from the source to the destination |
Options
Cancel profile if an error occurs
This option causes the profile to be terminated if an error occurs in the script or the script cannot be run for launching the profile. An error message is displayed in the log. No error message appears in the log when the VB script returns the special error code -99.Sample Scripts
The sample scripts supplied with AllSync are located in theScripts
subdirectory of the AllSync application folder.
The sample scripts are continuously updated and adapted by us as needed.
When making changes to the sample scripts, make sure to save them under a different name otherwise they will be overwritten and your changes lost the next time you update AllSync.
The following scripts are currently available:
CheckDestinationFolder.vbs
This script checking the first destination folder to see if it exists. The script returns the error code -99 if the folder is not accessible. See option Cancel profile if an error occurs.CheckDestinationFolderWithMessageBox.vbs
This script checking the first destination folder to see if it exists. An info dialog pop up if the folder is not accessible. Now the user can retry the folder check or cancel the profile.CloseApp.vbs
This script enables you to close other applications.ExportRegistry.vbs
This script enables you to export a registry key to a file at the destination folder.IsDestinationFolderEmpty.vbs
This script checking the first destination folder to see if it exists. The script returns the error code -99 if the folder is empty. See option Cancel profile if an error occurs.KillTask.vbs
This script enables you to end a task. Call Windows Task Manager to find out the requisitetask name
.
MessageBoxWithTimer.vbs
With this script, the user is shown a confirmation dialog for 5 seconds. The script returns error code -99 when the user presses the Cancel button. See option Cancel profile if an error occurs.Outlook.vbs
This script enables you to shut down Microsoft Outlook.OutlookExpress.vbs
This script enables you to shut down Microsoft Outlook Express.RenameFileAndCreateFileHistory.vbs
This script renames the copy.txt file by adding an ascending sequence number to the end of the file name to create a file history. Example: "copy0001.txt", "copy0002.txt", ... For example, you can use this script with the log file option Copy profile log file to destination folder. To do this, start the script before a copy operation to rename an existing log file in the destination folder.Run.vbs
This script enables you to run any program by inserting thePrg
variable in the program path.