# Using system.util.execute on gateway to run command line applications

**URL:** <https://forum.inductiveautomation.com/t/using-system-util-execute-on-gateway-to-run-command-line-applications/15131>\
**Category:** Ignition\
**Created:** [August 22, 2017, 4:53am UTC](https://forum.inductiveautomation.com/t/using-system-util-execute-on-gateway-to-run-command-line-applications/15131 "2017-08-22T04:53:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![naturesbeast](https://avatars.discourse-cdn.com/v4/letter/n/d07c76/32.png) [@naturesbeast](https://forum.inductiveautomation.com/u/naturesbeast)\
**Post date:** [August 22, 2017, 4:53am UTC](https://forum.inductiveautomation.com/t/using-system-util-execute-on-gateway-to-run-command-line-applications/15131/1 "2017-08-22T04:53:46Z")

</div>

I’m trying to execute xcopy.exe on a gateway event script using the following code:

cmd = [‘c:/windows/syswow64/xcopy.exe’, ‘\\l2-video-1\images’, ‘e:\images\’, ‘/S’, ‘/D’, ‘/C’, ‘/Y’]  
system.util.execute(cmd)

The code executes fine using the console but doesn’t work at all when executed from within a gateway event (tag change) script. I’ve put additional code in to trap the procedure so I know that it is executing on the gateway. I’ve also turned UAC off. Any other ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![mgross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mgross/32/3311_2.png) [@mgross](https://forum.inductiveautomation.com/u/mgross)\
**Post date:** [August 22, 2017, 2:28pm UTC](https://forum.inductiveautomation.com/t/using-system-util-execute-on-gateway-to-run-command-line-applications/15131/2 "2017-08-22T14:28:43Z")

</div>

The difference might be the user running the script. When you run the script out of the console, the Windows user is you, so everything works. But when the script runs under the gateway, it runs as the Windows service user.

---

<div class="post-metadata">

**Author:** ![naturesbeast](https://avatars.discourse-cdn.com/v4/letter/n/d07c76/32.png) [@naturesbeast](https://forum.inductiveautomation.com/u/naturesbeast)\
**Post date:** [August 26, 2017, 4:54am UTC](https://forum.inductiveautomation.com/t/using-system-util-execute-on-gateway-to-run-command-line-applications/15131/3 "2017-08-26T04:54:00Z")

</div>

Thanks mgross. I think you’re right. I’ve pursued doing the same operation using the [java.io](http://java.io) and shutil libraries.
