# Gateway Update event - execute .bat file

**URL:** <https://forum.inductiveautomation.com/t/gateway-update-event-execute-bat-file/37021>\
**Category:** Ignition\
**Created:** [July 23, 2020, 10:13pm UTC](https://forum.inductiveautomation.com/t/gateway-update-event-execute-bat-file/37021 "2020-07-23T22:13:05Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [July 25, 2020, 12:42am UTC](https://forum.inductiveautomation.com/t/gateway-update-event-execute-bat-file/37021/4 "2020-07-25T00:42:14Z")

</div>

One thing to consider is that in some odd cases `time.sleep` raises a `java.lang.IllegalArgumentException` as experienced by me.

So for your script it would be something like this:

```python
logger = system.util.getLogger("SF_GW_UpdateScript")
logger.info("Running git update!")
from java.lang import Thread
Thread.sleep(5000)
system.util.execute(["C:\Program Files\Inductive Automation\Ignition\data\git-auto-commit.bat"])

```

Reference:

> [@Importing time module bug](http://forum.inductiveautomation.com/t/importing-time-module-bug/33906/5):
>
> I tested the following code, and hereby I confirm that switching to java.lang.Thread solves the problem experienced with Python’s time module. import system.date from java.lang import Exception as JException, Thread def java\_sleep(): print 'Thread.sleep' print system.date.now() Thread.sleep(5000) print system.date.now() def py\_sleep(): print 'time.sleep' import time print system.date.now() time.sleep(5) print system.date.now() try: java\_sleep() p…

---

_[View the full topic](https://forum.inductiveautomation.com/t/gateway-update-event-execute-bat-file/37021)._
