Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi I am trying to use this Code inside Thingworx JavaScript service.
I am getting syntax error on highlighted portion.
Appreciate your help in this.
<html><head>
<title>Application Executer</title>
<HTA:APPLICATION ID="oMyApp"
APPLICATIONNAME="Application Executer"
BORDER="no" CAPTION="no"
SHOWINTASKBAR="yes" SINGLEINSTANCE="yes" S
YSMENU="yes" SCROLL="no" WINDOWSTATE="normal">
<script type="text/javascript" language="javascript">
function RunFile()
{
h2.
WshShell = new ActiveXObject("WScript.Shell")
WshShell.Run(Exe + " " + JobId, 1, false)
}
</script></head><body>
<input type="button" value="Run Subthermal" onclick="RunFile();"/></body></html>
Are you trying to execute a file Server side or Client side?
I am trying to execute a file Server side.
We have a nested .exe file which we tried to execute from SQL Server Stored Procedure. It looks like only the outer executable is being executed and not the inner one (this is a fortran .exe).
So we tried to do it this way.
Hi Sabarish,
1. The code that you displayed on your answer contains HTML elements. In a ThingWorx service you can only put Javascript code.
2. The ActiveXObject is only available in an IE Browser...not in a server side code.
3. If you must run an executable, server side, my first choice would be an Extension to ThingWorx that'll wrap the call to that exe file. That Extension will have a service with a parameter like JobID in your case.
Hope it helps!
BR,
Vladimir
Hi Sabarish,
I am having the same requirement. Are you able to do this from thingworx and how?