[id='cli-batching-files_{context}']
= Performing Batch Operations with Files
Create files that contain a set of operations and then pass them to the {brandname} CLI.

.Procedure

. Create a file that contains a set of operations.
+
For example, create a file named `batch` that creates a cache named `mybatch`, adds two entries to the cache, and disconnects from the CLI.
+
[source,options="nowrap",subs=attributes+]
----
connect --username=<username> --password=<password> <hostname>:11222
create cache --template=org.infinispan.DIST_SYNC mybatch
put --cache=mybatch hello world
put --cache=mybatch hola mundo
ls caches/mybatch
disconnect
----
+
[TIP]
====
Configure the CLI with the `autoconnect-url` property instead of using the `connect` command directly in your batch files.
====
+
. Run the CLI and specify the file as input.
+
[source,options="nowrap",subs=attributes+]
----
$ bin/cli.sh -f batch
----

[NOTE]
====
CLI batch files support system property expansion. Strings that use the
`${property}` format are replaced with the value of the `property` system
property.
====
