Error opening a file with system.net.openURL

I have an error trying to open a file with the function system.net.openURL
My code is:

filePath='C:\Users\l.abdallah.ext\Desktop\20201120_134830_AlarmStatusTable.xlsx'

system.net.openURL("file:" + filePath)

Error:

java.io.IOException: java.io.IOException: Cannot run program "command.com": CreateProcess error=2, , The system cannot find the file specified

Ignition 8.0.12
Windows 10 x64

Thanks you

Try escaping your backslashes, python. Right now it’s reading your filePath as:
C:\Users\l.abdallah.ext\Desktop�01120_134830_AlarmStatusTable.xlsx

filePath='C:\\Users\\l.abdallah.ext\\Desktop\\20201120_134830_AlarmStatusTable.xlsx'
print filePath
>>> C:\Users\l.abdallah.ext\Desktop\20201120_134830_AlarmStatusTable.xlsx

Also, I believe you need double forward slashes after file:.

filePath='C:\\Users\\l.abdallah.ext\\Desktop\\20201120_134830_AlarmStatusTable.xlsx'

system.net.openURL("file://" + filePath)

https://docs.inductiveautomation.com/display/DOC79/system.net.openURL

thanks for the answer guys, but I still have the problem. :expressionless: :expressionless:

Try a simpler path, like c:\\temp\\new.txt

i think it’s java problem

Traceback (most recent call last):  
  File "<event:mouseClicked>", line 92, in <module>  
    at java.base/java.lang.ProcessBuilder.start(Unknown Source)  
    at java.base/java.lang.ProcessBuilder.start(Unknown Source)  
    at java.base/java.lang.Runtime.exec(Unknown Source)  
    at java.base/java.lang.Runtime.exec(Unknown Source)  
    at com.inductiveautomation.ignition.client.util.BrowserLauncher.browse(BrowserLauncher.java:644)  
    at com.inductiveautomation.ignition.client.util.BrowserLauncher.openURL(BrowserLauncher.java:557)  
    at com.inductiveautomation.factorypmi.application.script.builtin.VisionNetUtilities.openURL(VisionNetUtilities.java:67)  
    at com.inductiveautomation.factorypmi.application.script.builtin.VisionNetUtilities.openURL(VisionNetUtilities.java:46)  
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)  
java.io.IOException: java.io.IOException: Cannot run program "command.com": CreateProcess error=2, El sistema no puede encontrar el archivo especificado  
  
    at org.python.core.Py.JavaError(Py.java:552)  
    at org.python.core.Py.JavaError(Py.java:543)  
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)  
    at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(ScriptManager.java:521)  
    at org.python.core.PyObject.__call__(PyObject.java:480)  
    at org.python.core.PyObject.__call__(PyObject.java:484)  
    at org.python.pycode._pyx37.f$0(<event:mouseClicked>:92)  
    at org.python.pycode._pyx37.call_function(<event:mouseClicked>)  
    at org.python.core.PyTableCode.call(PyTableCode.java:171)  
    at org.python.core.PyCode.call(PyCode.java:18)  
    at org.python.core.Py.runCode(Py.java:1614)  
    at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:779)  
    at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:206)  
    at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:297)  
    at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)  
    at com.sun.proxy.$Proxy58.mouseClicked(Unknown Source)  
    at java.desktop/java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)  
    at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)  
    at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)  
    at java.desktop/java.awt.Component.processEvent(Unknown Source)  
    at java.desktop/java.awt.Container.processEvent(Unknown Source)  
    at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)  
    at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)  
    at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)  
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)  
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)  
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)  
    at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)  
    at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)  
    at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)  
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)  
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)  
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)  
    at java.base/java.security.AccessController.doPrivileged(Native Method)  
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)  
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)  
    at java.desktop/java.awt.EventQueue$5.run(Unknown Source)  
    at java.desktop/java.awt.EventQueue$5.run(Unknown Source)  
    at java.base/java.security.AccessController.doPrivileged(Native Method)  
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)  
    at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)  
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)  
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)  
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)  
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
    at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)  
Caused by: java.io.IOException: Cannot run program "command.com": CreateProcess error=2,The system cannot find the file specified
    at java.base/java.lang.ProcessBuilder.start(Unknown Source)  
    at java.base/java.lang.ProcessBuilder.start(Unknown Source)  
    at java.base/java.lang.Runtime.exec(Unknown Source)  
    at java.base/java.lang.Runtime.exec(Unknown Source)  
    at com.inductiveautomation.ignition.client.util.BrowserLauncher.browse(BrowserLauncher.java:644)  
    at com.inductiveautomation.ignition.client.util.BrowserLauncher.openURL(BrowserLauncher.java:557)  
    at com.inductiveautomation.factorypmi.application.script.builtin.VisionNetUtilities.openURL(VisionNetUtilities.java:67)  
    at com.inductiveautomation.factorypmi.application.script.builtin.VisionNetUtilities.openURL(VisionNetUtilities.java:46)  
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)  
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)  
    ... 44 more  
Caused by: java.io.IOException: CreateProcess error=2,The system cannot find the file specified  
    at java.base/java.lang.ProcessImpl.create(Native Method)  
    at java.base/java.lang.ProcessImpl.<init>(Unknown Source)  
    at java.base/java.lang.ProcessImpl.start(Unknown Source)  
    ... 57 more  
  
Ignition v8.0.12 (b2020042115)  
Java: Azul Systems, Inc. 11.0.6 

Hi , did you find a solution? I have the same problem, it used to work fine before.

What version of Ignition and Windows are you using (full version including patches if possible)? Did you install a Windows update recently?

Hi,
Thanks for fast reply. We are currently working on igntion 8.1 with windows server 2019 up too 1809. We recently update to the latest igntion as well as updating oir windows server.

What version of Windows is the client or designer that is running this function? It doesn’t matter as much what Windows version the gateway is running on.

Hi, we are running the client on windows server 2019 also and accessing it via remote desktop app on an android tablet.
Thanks

windows server 2019 standard

Hi, a friend found a way to work around the problem try this:
system.util.execute([‘explorer.exe’, ‘‘selectedfilepathhere’’])
Let me know if it works!