About running command files during a backup

You can use command files (.exe, .cmd, .bat) during a backup. You can use command files to integrate Norton Ghost with other backup routines that you might be running on the computer. You can also use command files to integrate with other applications that use a drive on the computer.


You cannot run command files that include a graphical user interface, such as notepad.exe. Running such command files will cause the backup job to fail.

You can run a command file during any of the following stages during the creation of a recovery point:

You can also specify the amount of time (in seconds) that a command file should be allowed to run.

You can specify the location of command files if you want them to be located in a place other than the default location. You can also specify a location on a per-job basis, as well as specify a location that can be shared among several computers. If you specify a network location, you will be asked for network credentials.

The most common use for running command files is to stop and restart non-VSS-aware databases that you want to back up.

To use a Visual Basic script file (.VBS) during a backup, you can create a batch file (.BAT) to run the script. For example, you can create a batch file called STOP.BAT that contains the following syntax:

Cscript script_filename.vbs

Make sure that Cscript precedes the file name of the Visual Basic script.


The command files cannot depend on any user interaction or have a visible user interface. You should test all command files independently of Norton Ghost before you use them during a backup.

When the backup begins, the command file is run during the specified stage. If an error occurs while a command file is running or the command file does not finish in the time you specified (regardless of the stage), the backup is stopped, the command file is terminated (if necessary), and the error information is logged and displayed.

The following table describes the stages of recovery point creation.

Table: Recovery point creation stages



Run before snapshot creation

This stage occurs after a backup has started and before a recovery point is created. You can run a command during this stage to prepare for the recovery point creation process. For example, you can close any open applications that are using the drive.


If you use this option, be sure the command file has an error recovery mechanism built into it. If the computer has one or more services that must be stopped at this stage (such as stopping a non-VSS aware database or a resource intensive application), and the command file does not contain any form of error recovery, one or more of the stopped services may not be restarted. An error in the command file can cause the recovery point creation process to stop immediately. No other command files will run.

See How you use Norton Ghost.

Run after snapshot creation

This stage occurs after a snapshot is created. Running a command during this stage is typically a safe point for allowing services to resume normal activity on the drive while continuing the recovery point creation.

Because the snapshot takes only a few seconds to create, the database is in the backup state momentarily. A minimal number of log files are created.

Run after recovery point creation

This stage occurs after the recovery point file is created. You can run a command during this stage to act on the recovery point itself. For example, you can copy it to an offline location.