Generating a VBScript Source File


- Overview

- Generating a VBScript

- VBScript Generation Options

- Output

- Shutdown

- Run Once Once a Day

- Run Programs

- Elevation

- Directory Synchronization


Overview

A VBScript file can be created for a disk image, file and folder backup, and disk clone definition files. If you have not already created a definition file to run one of these options, see the links below to create a definition file, and then follow the steps below to create a VBScript:

- Creating a Disk Image

- Creating a File and Folder Backup

- Cloning a Disk


Generating a VBScript

VBScript files can be created for a backup definition on the 'Definition Files' tab under the 'Create Backups' tab:

Right-click on the backup definition that will be used for the VBScript creation, then select 'Generate a VBScript File...':


VBScript Generation Options

In the window that opens, options can be specified for the VBScript file:

Output

The first page of the 'VBScript Generation Options' wizard is used to specify where the VBScript file will be saved, and the name of the VBScript file:

Shutdown

The 'Shutdown' option can be used to specify whether the computer should shut down or log off following the script's execution. Leaving this option unchecked will not apply any power-saving options:

Run Once A Day

When enabled, the script will be capped at running once per day. This can be useful when scripts are configured to execute on a behavior like logon or logoff.

Run Programs

This page enables a script or program to be run at the start or end of the script. 

Option Description
Run a program or script at the start When enabled, a script or program will run before the backup process starts.
File name

The full path and file name of the script or executable that will be run before the backup takes place.

The icon can be used to open an Explorer window that can be used to interactively select the script or program.

Parameters Optional command line parameters for the program that is launched.
Run a program or script at the end When enabled, a script or program will run after the backup process completes.
File name

The full path and file name of the script or executable that will be run after the backup takes place.

The icon can be used to open an Explorer window that can be used to interactively select the script or program.

Parameters Optional command line parameters for the program that is launched.

If the specified file or program cannot be found or accessed, the following error message will be displayed:

Elevation

When this option is selected, the script will prompt to run with elevated privileges. All called programs will subsequently run with elevated privileges. If the script is going to be run on a schedule, then this option is not necessary, as the scheduler will run the script with elevated privileges.

Directory Synchronization

Directory synchronization enables backups to be easily copied from the backup destination to a second location for redundancy. This ensures that even if the backups in the destination become unavailable (e.g. through hardware failure), a second copy of the backup can be used to recover in the event of a disaster.

Due to how backup sets are created and maintained, it is essential to synchronize all files in the backup set rather than just copy the most recently created file, as data in previous backups may have changed due to retention and consolidation rules. To ensure that the synchronized directories are kept in sync, the 'Directory Synchronization' option when creating a script will make use of Robocopy, a Windows feature that can easily synchronize two folders.

Option Description
Enable Directory Synchronization If enabled, Macrium Reflect will use RoboCopy to synchronize the backup destination directory with the directory specified in the 'Directory' field.
Directory

The full path to the folder that will be used as the destination for the synchronization.

Warning: The RoboCopy command used by Macrium Reflect uses the '/purge' switch, which will delete any folders in the destination that do not exist in the source. It is strongly advised that any user data in the destination folder for the synchronization be moved. Read more about RoboCopy here.