# How can I run a command in the Gateway scope?

**URL:** <https://forum.inductiveautomation.com/t/how-can-i-run-a-command-in-the-gateway-scope/44960>\
**Category:** Ignition\
**Created:** [March 26, 2021, 2:39pm UTC](https://forum.inductiveautomation.com/t/how-can-i-run-a-command-in-the-gateway-scope/44960 "2021-03-26T14:39:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kghali](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@kghali](https://forum.inductiveautomation.com/u/kghali)\
**Post date:** [March 26, 2021, 2:39pm UTC](https://forum.inductiveautomation.com/t/how-can-i-run-a-command-in-the-gateway-scope/44960/1 "2021-03-26T14:39:02Z")

</div>

The user holding the project has access to a location on the network but when I run:  
system.file.readFileAsString(path)  
the access is denied.

I am running the command from Scripting --\> Project Library

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [March 26, 2021, 2:44pm UTC](https://forum.inductiveautomation.com/t/how-can-i-run-a-command-in-the-gateway-scope/44960/2 "2021-03-26T14:44:41Z")

</div>

Use a gateway message handler.

[https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts](https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts)  
[https://docs.inductiveautomation.com/display/DOC81/system.util.sendMessage](https://docs.inductiveautomation.com/display/DOC81/system.util.sendMessage)  
[https://docs.inductiveautomation.com/display/DOC81/system.util.sendRequest](https://docs.inductiveautomation.com/display/DOC81/system.util.sendRequest)  
[https://docs.inductiveautomation.com/display/DOC81/system.util.sendRequestAsync](https://docs.inductiveautomation.com/display/DOC81/system.util.sendRequestAsync)
