# Scripting Error when trying to link out to Power Point

**URL:** <https://forum.inductiveautomation.com/t/scripting-error-when-trying-to-link-out-to-power-point/20383>\
**Category:** General Discussion\
**Created:** [October 25, 2018, 7:17pm UTC](https://forum.inductiveautomation.com/t/scripting-error-when-trying-to-link-out-to-power-point/20383 "2018-10-25T19:17:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngadow](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@ngadow](https://forum.inductiveautomation.com/u/ngadow)\
**Post date:** [October 25, 2018, 7:17pm UTC](https://forum.inductiveautomation.com/t/scripting-error-when-trying-to-link-out-to-power-point/20383/1 "2018-10-25T19:17:35Z")

</div>

I’ve used this method to open other programs but cannot get it to work for Word or PowerPoint. For the purpose of testing I made a button and gave it a script to locate and open PowerPoint - then where to go look for the actual file to open.

system.util.execute([“C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Word 2016.lnk”,“L:\Training\Online Help Files\sample.pptx”])

Error text below

Ignition version - 7.9.6 (b2018012914)  
Testing on Windows 10 64bit pc

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e1759a9304ef5f65d6c55965b5cd8fc9ab1d9e90.png)

Traceback (most recent call last):  
File “event:actionPerformed”, line 1, in   
at java.lang.ProcessBuilder.start(Unknown Source)

```
at java.lang.Runtime.exec(Unknown Source)

at java.lang.Runtime.exec(Unknown Source)

at com.inductiveautomation.ignition.common.script.builtin.SystemUtilities.execute(SystemUtilities.java:100)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

```

java.io.IOException: java.io.IOException: Cannot run program “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\PowerPoint 2016.lnk”: CreateProcess error=193, %1 is not a valid Win32 application

```
at org.python.core.Py.JavaError(Py.java:495)
at org.python.core.Py.JavaError(Py.java:488)
at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:188)
at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. __call__ (ScriptManager.java:429)
at org.python.core.PyObject. __call__ (PyObject.java:387)
at org.python.core.PyObject. __call__ (PyObject.java:391)
at org.python.pycode._pyx34.f$0(<event:actionPerformed>:1)
at org.python.pycode._pyx34.call_function(<event:actionPerformed>)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1275)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:634)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:180)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:271)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
at com.sun.proxy.$Proxy17.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

```

Caused by: java.io.IOException: Cannot run program “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\PowerPoint 2016.lnk”: CreateProcess error=193, %1 is not a valid Win32 application  
at java.lang.ProcessBuilder.start(Unknown Source)  
at java.lang.Runtime.exec(Unknown Source)  
at java.lang.Runtime.exec(Unknown Source)  
at com.inductiveautomation.ignition.common.script.builtin.SystemUtilities.execute(SystemUtilities.java:100)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
at java.lang.reflect.Method.invoke(Unknown Source)  
at org.python.core.PyReflectedFunction. **call** (PyReflectedFunction.java:186)  
… 49 more  
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application  
at java.lang.ProcessImpl.create(Native Method)  
at java.lang.ProcessImpl.(Unknown Source)  
at java.lang.ProcessImpl.start(Unknown Source)  
… 58 more

Ignition v7.9.6 (b2018012914)  
Java: Oracle Corporation 1.8.0\_181

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [October 25, 2018, 8:19pm UTC](https://forum.inductiveautomation.com/t/scripting-error-when-trying-to-link-out-to-power-point/20383/2 "2018-10-25T20:19:19Z")

</div>

.lnk is a link to an executable file. What happens when you try to open the actual executable?

---

<div class="post-metadata">

**Author:** ![ngadow](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@ngadow](https://forum.inductiveautomation.com/u/ngadow)\
**Post date:** [October 25, 2018, 8:40pm UTC](https://forum.inductiveautomation.com/t/scripting-error-when-trying-to-link-out-to-power-point/20383/3 "2018-10-25T20:40:06Z")

</div>

I don’t really know. I’ve always done the shift+right click and use the Copy as path - then the same for where my document is.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1ea3a2b273c33e76700264d4af84c86094d84692.png)

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [October 25, 2018, 8:43pm UTC](https://forum.inductiveautomation.com/t/scripting-error-when-trying-to-link-out-to-power-point/20383/4 "2018-10-25T20:43:42Z")

</div>

Navigate to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ in Explorer, find the .lnk file, right click and go to Properties, and find Target. It’ll be a .exe file. Use that path in system.util.execute instead of C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Word 2016.lnk

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a2a2e629e6bc8e16aa88932727f05b776ad3f9ec.png)

---

<div class="post-metadata">

**Author:** ![ngadow](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@ngadow](https://forum.inductiveautomation.com/u/ngadow)\
**Post date:** [October 25, 2018, 8:58pm UTC](https://forum.inductiveautomation.com/t/scripting-error-when-trying-to-link-out-to-power-point/20383/5 "2018-10-25T20:58:43Z")

</div>

Yep - I finally dug around until I found the actual exe for PowerPoint - It’s working now - thanks!!

“C:\Program Files\Microsoft Office\Office16\POWERPNT.EXE”
