All, I'm writing a Rails based app. I'm still on Rails version 1.2.2. I need to start an external app from within the browser, only IE and pass an argument to it. The only way I found was using ActiveX.
<script language="javascript" type="text/javascript"> function OpenFile(cmd){ var x = new ActiveXObject("WScript.Shell"); x.run(cmd) } </script>
and then call it with
onClick="OpenFile('C:\\projects\\some.exe c:\\projects\ \someinputfile.rpt')
This works if I just use a regular HTML file and call it. In Rails for testing I call it like this:
<div> some content </div> <script type="text/javascript"> function OpenFile(){ alert("Starting ActiveX"); var x = new ActiveXObject("WScript.Shell"); x.run("C:\\projects\\some.exe c:\\projects\ \someinputfile.rpt') }
OpenFile(); </script>
The function gets called but the ActiveXObject never gets created. Any ideas? Regards Peter