# Error trying to get Ignition to run a batch file at specified time based on Tag Values

**URL:** <https://forum.inductiveautomation.com/t/error-trying-to-get-ignition-to-run-a-batch-file-at-specified-time-based-on-tag-values/22614>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [February 15, 2019, 4:05pm UTC](https://forum.inductiveautomation.com/t/error-trying-to-get-ignition-to-run-a-batch-file-at-specified-time-based-on-tag-values/22614 "2019-02-15T16:05:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [February 15, 2019, 4:05pm UTC](https://forum.inductiveautomation.com/t/error-trying-to-get-ignition-to-run-a-batch-file-at-specified-time-based-on-tag-values/22614/1 "2019-02-15T16:05:03Z")

</div>

I have a new simple project that is only meant to do one thing, on 2 pm every Friday run a batch file. It was giving me issues doing it strictly in the tags, so I tried bringing the logic over to a button for testing and it works fine. Any idea why?

This is the script attached to the button -

```auto
if system.tag.read("DayOfWeek").value==5 and system.tag.read("HourOfDay").value==14:
	system.util.execute(["C:\NAS_Backup_BatFiles\Bay1_Cust_Backup.bat"])

```

And similarly for inside the HourOfDay Tag Event valueChanged -

```auto
if system.tag.read("[~]DayOfWeek").value==5 and system.tag.read("[~]HourOfDay").value==14:
	system.util.execute(["C:\NAS_Backup_BatFiles\Bay1_Cust_Backup.bat"])

```

I know this must be a syntax thing. What is going wrong here?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 15, 2019, 4:14pm UTC](https://forum.inductiveautomation.com/t/error-trying-to-get-ignition-to-run-a-batch-file-at-specified-time-based-on-tag-values/22614/2 "2019-02-15T16:14:58Z")

</div>

Try using the full tag path name (e.g.: “[default]DayOfWeek”)

I’ve gotten into the habit of always using a full path, since it’s bitten me once or thrice.

You may also consider using a gateway tag event script. I’ve nothing against tag scripts, but I seem to have better luck with the event scripts…

I also remember there are occasions where you need to import system. I just can’t remember specifically where…
