# Batch File Tab

The Batch File tab is used to generate a script that can be used to launch CopyStorm as a batch job. Generated scripts encapsulate everything needed to run a CopyStorm job, including:

* The location of CopyStorm.
* The location of the configuration file defining backup parameters.

For many sites a generated batch file is not necessary due to built-in command line options in the main CopyStorm launch script allowing batch mode execution. Example command lines include:

* sh CopyStorm.sh -run /path/to/my/configFile.copyStorm
* CopyStorm.bat -run C:\path\to\my\configFile.copyStorm

## The Core Tool

The core function of the Batch File tab is to generate a script file that will:

* Run CopyStorm using a specific configuration file from any directory using just the name of the script file.
* Capture any exception information from CopyStorm to “do something” with the data. By default the script emails exception information to a user but this can easily be adapted to other purposes.

![](https://4057376488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsbSqfKw3vSfr8qwXao4j%2Fuploads%2Fgit-blob-2cf7a9f44b51c6b7c5592f16d4bc722f9075d8f2%2F43247fa8-Batch-File-tab.png?alt=media)

If you have configured the [Notifications tab](https://learn.capstorm.com/reference/notifications-tab), the process for generating a script file is simple. This is the approach used nearly 100% of the time:

* Use the “Script Format” menu to specify the desired scripting language — bash, bat, python, or vbs.
* Click on the “Generate Script” button.
* Click on the “Save Script” button and save the script to a file.

If your site cannot use the built-in Notification system the process for generating a script file is:

* Use the “Script Format” menu to select one of the script formats marked as Advanced.
* Enter an email address for the notification sent each time the script runs.
* Enter an email address for the notification sent if CopyStorm reports an exception.
* Enter the name of your local SMTP server.
  * In the example a public server hosted by Google is used.
* Enter the email address that will send the email.
* Click on the “Generate Script” button.
* Click on the “Save Script” button and save the script to a file.
* Edit the generated script’s code to implement your custom notification requirements.

After these steps are completed, you own the generated script file and can change it in any way you prefer.

If you have trouble getting the email portion to work properly, please read [this FAQ](https://learn.capstorm.com/frequently-asked-questions/installation/why-is-my-batch-file-not-sending-email).


---

# 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://learn.capstorm.com/reference/batch-file-tab.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.
