# Script to launch a project

**URL:** <https://forum.inductiveautomation.com/t/script-to-launch-a-project/9425>\
**Category:** Ignition\
**Created:** [December 10, 2014, 3:45pm UTC](https://forum.inductiveautomation.com/t/script-to-launch-a-project/9425 "2014-12-10T15:45:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brett\_Yeomans](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brett\_Yeomans](https://forum.inductiveautomation.com/u/Brett_Yeomans)\
**Post date:** [December 10, 2014, 3:45pm UTC](https://forum.inductiveautomation.com/t/script-to-launch-a-project/9425/1 "2014-12-10T15:45:13Z")

</div>

Is there a way for a gateway script to launch a project on the server that the gateway resides on?  
I have tried various:

```auto
system.util.execute(["C:\\WINDOWS\\system32\\javaws.exe -localfile -J-Djnlp.application.href=http://wbx3:8088/main/system/launch/client/RunOnServer.jnlp \"C:\\Documents and Settings\\bxy\\Local Settings\\Application Data\\Sun\\Java\\Deployment\cache\\6.0\\9\\55252289-1f6035bf\""])
```

etc, but to no avail. Is this even possible?  
I can get .exe files on the desktop to function with the above but not .jnlp’s

---

<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:** [December 10, 2014, 3:52pm UTC](https://forum.inductiveautomation.com/t/script-to-launch-a-project/9425/2 "2014-12-10T15:52:09Z")

</div>

Even if you got this working, the problem here is that jnlp cache files are highly unstable. It may work for a little while, but then fail at some random point later due to javaws reshuffling its cache. You are much better off calling the native client launcher exe from your script and passing in whatever you need.

---

<div class="post-metadata">

**Author:** ![Brett\_Yeomans](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brett\_Yeomans](https://forum.inductiveautomation.com/u/Brett_Yeomans)\
**Post date:** [December 10, 2014, 3:57pm UTC](https://forum.inductiveautomation.com/t/script-to-launch-a-project/9425/3 "2014-12-10T15:57:50Z")

</div>

Thanks mgross, any chance you could expand a little on that? Maybe a tiny example ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [December 10, 2014, 4:41pm UTC](https://forum.inductiveautomation.com/t/script-to-launch-a-project/9425/4 "2014-12-10T16:41:45Z")

</div>

Some examples are at the end of this webpage: [support.inductiveautomation.com … uncher.htm](https://support.inductiveautomation.com/usermanuals/ignition/index.html?native_client_launcher.htm)

---

<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:** [December 10, 2014, 6:57pm UTC](https://forum.inductiveautomation.com/t/script-to-launch-a-project/9425/5 "2014-12-10T18:57:20Z")

</div>

So it looks like this isn’t going to work on Windows from a Gateway script, even with the native launcher. The problem is that the Gateway runs as a Windows service, which by default does not have graphical access to the local Desktop. Even if you tweak the Ignition service to run under a specific user, using system.util.execute still won’t work, as Windows refuses to show the client (even if it launched the process without errors).

---

<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:** [December 10, 2014, 9:11pm UTC](https://forum.inductiveautomation.com/t/script-to-launch-a-project/9425/6 "2014-12-10T21:11:12Z")

</div>

Great. Now y’all my my mind spinning… 😆

@Brett, can I ask for a bigger picture on what you’re trying to do? Or why… 😉

I’m just wondering if the project can launch on startup or just every so often, or whatever…

---

<div class="post-metadata">

**Author:** ![Brett\_Yeomans](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brett\_Yeomans](https://forum.inductiveautomation.com/u/Brett_Yeomans)\
**Post date:** [December 11, 2014, 8:17am UTC](https://forum.inductiveautomation.com/t/script-to-launch-a-project/9425/7 "2014-12-11T08:17:17Z")

</div>

@JordanCClark, I have a project that runs on the server to grab screenshots and email them etc.  
A while back I played with the native launcher and believe this to be working (for server boot up). I have some client scripts that toggles a memory tag which a gateway script can detect if the project is running or not. I then wished to automatically launch the project should it be shut down for whatever reason. Over-kill maybe, but seemed a good idea at the time.

So I tried it with Wintail.exe on the same server/desktop and it launched it, so I thought it was only a matter of knowking how to handle jnlp shortcuts…looks like I might be wrong 😕
