# Batch Mode

* Go to \<installation folder>/dbsync/scripts. Make sure that setenv.bat points to your installation directory.
* To enable return code go to batch file run.bat found in scripts folder.Replace the existing commands in the last section of run.bat with the new commands shown below. Return code “0” will be displayed in command prompt after successful replication. If there is any error during replication, retun code “-1” will be displayed.

**Existing command:**

%JAVA\_HOME%\bin\java -Xmx512m -Dinstance=%1 -Dconfig.dir=%CONFIG\_DIR% -classpath %CLASSPATH% com.dbsync.salesforce.dbsynch.Driver %2 %3 %4

**New command:**

%JAVA\_HOME%\bin\java -Xmx512m -Dinstance=%1 -DconsoleExitCode=true -Dconfig.dir=%CONFIG\_DIR% -classpath %CLASSPATH% com.dbsync.salesforce.dbsynch.Driver %2 %3 %4

set ExitCode=%ERRORLEVEL%

echo %ExitCode%

Commands to run replication with example is shown below.

* Sync schema Run – run <\<profile name>> db\_setup
  * Example: run dbsync db\_setup
* For getting a clean copy Run – run <\<profile name>> cleancopy
  * Example: run dbsync cleancopy

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mydbsync.com/cloud-replication-main/batch-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
