Creating a script file
There are no restrictions on the name, extension, or location of the script file. Although a simple text editor like Notepad will typically be used to create a script file, any plain text editor can be used to create script files.
Script files must contain a strict sequence of Management Console commands. Logic statements are not supported in script files. Each command in a script file must end with a semicolon (;).
Comments
In addition to Management Console commands, you can include comments. In script files, a comment line starts with two consecutive forward slash characters (//) and continues to the end of the line. A comment line or block is not terminated by a recognized character or character sequence.
When compiling a script file, comments are ignored.
Commands
All Management Console commands that you can interactively submit may be included in a script file. However, you should avoid including an execute command that references the script file in which the command is contained. This results in recursive batch file executions without termination.
In addition, you should only include commands that you can perform based on your current role.
Sample Script File
The following sample script file can be modified for your working environment:
// This script file starts replication for tables that have been
// selected to a subscription, successfully described, and assigned
// to subscription tables.
//
// Connect to Access Server.
connectServer(EAHIGGINS, PINEAPPLE, LOCALHOST, 10101);
//
// Connect to datastore.
connectAgent(HQAGENT);
//
// In the event that replication is in progress, stop all replication
// activities.
stopAll(HQAGENT);
//
// Perform an initial refresh.
startRefresh(HQAGENT, BRANCHSYS, *all);
//
// Start mirroring.
startMirror(HQAGENT, BRANCHSYS, continuous);
//
// If an error is encountered during a batch file run, continue
// processing.
errorHandle(continue);
//
// Run a batch file that displays subscription activity and status
// information.
execute(EA.BAT);
//
// Disconnect from datastore.
disconnectAgent(HQAGENT);
//
// Disconnect from Access Server.
disconnectServer();
After creating a script file, it must be compiled.