# Restart Ignition Gateway service and shutdown the gateway system from perspective client

**URL:** <https://forum.inductiveautomation.com/t/restart-ignition-gateway-service-and-shutdown-the-gateway-system-from-perspective-client/51433>\
**Category:** Ignition\
**Tags:** ignition80, perspective, scripting, ignition81\
**Created:** [September 29, 2021, 9:36am UTC](https://forum.inductiveautomation.com/t/restart-ignition-gateway-service-and-shutdown-the-gateway-system-from-perspective-client/51433 "2021-09-29T09:36:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajesh.dayala](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rajesh.dayala](https://forum.inductiveautomation.com/u/rajesh.dayala)\
**Post date:** [September 29, 2021, 9:36am UTC](https://forum.inductiveautomation.com/t/restart-ignition-gateway-service-and-shutdown-the-gateway-system-from-perspective-client/51433/1 "2021-09-29T09:36:56Z")

</div>

Hi All,

I have a requirement for Restarting the Gateway service and also shutdown the Gateway server from perspective client using button click.

If any one knows this, can you please post the script .

Thanks in advance  
Rajesh

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 29, 2021, 4:15pm UTC](https://forum.inductiveautomation.com/t/restart-ignition-gateway-service-and-shutdown-the-gateway-system-from-perspective-client/51433/2 "2021-09-29T16:15:51Z")

</div>

You could use `system.util.execute` to directly run the `gwcmd` utility.  
[https://docs.inductiveautomation.com/display/DOC81/Gateway+Command-line+Utility+-+gwcmd](https://docs.inductiveautomation.com/display/DOC81/Gateway+Command-line+Utility+-+gwcmd)

This is a pretty bad idea, I would say, but that’s probably where I’d start.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [September 30, 2021, 9:31pm UTC](https://forum.inductiveautomation.com/t/restart-ignition-gateway-service-and-shutdown-the-gateway-system-from-perspective-client/51433/3 "2021-09-30T21:31:13Z")

</div>

Send a message from client to gateway and use `system.util.execute` in the gateway message handler as @paul-griffith noted.

---

<div class="post-metadata">

**Author:** ![rajesh.dayala](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rajesh.dayala](https://forum.inductiveautomation.com/u/rajesh.dayala)\
**Post date:** [October 1, 2021, 12:11pm UTC](https://forum.inductiveautomation.com/t/restart-ignition-gateway-service-and-shutdown-the-gateway-system-from-perspective-client/51433/4 "2021-10-01T12:11:14Z")

</div>

Thanks for the response @paul-griffith.

---

<div class="post-metadata">

**Author:** ![rajesh.dayala](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rajesh.dayala](https://forum.inductiveautomation.com/u/rajesh.dayala)\
**Post date:** [October 1, 2021, 12:11pm UTC](https://forum.inductiveautomation.com/t/restart-ignition-gateway-service-and-shutdown-the-gateway-system-from-perspective-client/51433/5 "2021-10-01T12:11:38Z")

</div>

Thanks for the suggestion @witman 🙂

---

<div class="post-metadata">

**Author:** ![rajesh.dayala](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rajesh.dayala](https://forum.inductiveautomation.com/u/rajesh.dayala)\
**Post date:** [October 4, 2021, 11:12am UTC](https://forum.inductiveautomation.com/t/restart-ignition-gateway-service-and-shutdown-the-gateway-system-from-perspective-client/51433/6 "2021-10-04T11:12:03Z")

</div>

Thanks @witman, I was able to write a batch file code as below, and ran it from Gateway scope message handler, and it worked for me, I can able to restart the gateway from perspective button click.

@echo off  
set dirpath=%~dp0  
cd “C:/Program Files/Inductive Automation/Ignition”  
echo Restart gateway…  
gwcmd -r

---

<div class="post-metadata">

**Author:** ![ukamani](https://avatars.discourse-cdn.com/v4/letter/u/d9b06d/32.png) [@ukamani](https://forum.inductiveautomation.com/u/ukamani)\
**Post date:** [May 15, 2024, 11:53pm UTC](https://forum.inductiveautomation.com/t/restart-ignition-gateway-service-and-shutdown-the-gateway-system-from-perspective-client/51433/7 "2024-05-15T23:53:22Z")

</div>

Is this applicable with systems that have redundancy configured?  
I want to restart the backup gateway service whenever the sync between master and backup goes "Out-of-Date". Is it possible to modify this so that I can use it to restart just my backup gateway service?
