<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to call VBS-Script on Client with JSF?</title><link>https://answers.axonivy.com/questions/1470/how-to-call-vbs-script-on-client-with-jsf</link><description>&lt;p&gt;Hello!
Is it possible to call a VBS-Script, e.g. "test.vbs" on the Client?
The idea is to run the script to write data in the SAP-GUI which is also open on the client.
Kind Regards,
Helmut&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1470/how-to-call-vbs-script-on-client-with-jsf" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 08 Oct 2015 11:27:15 -0400</lastBuildDate><item><title>Answer by Helmut Burgemeister</title><link>https://answers.axonivy.com/questions/1470/how-to-call-vbs-script-on-client-with-jsf/1505</link><description>&lt;p&gt;Here an example for a button to call a VBS-script from IE:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div&amp;gt;
    &amp;lt;p:commandButton type="button" id="runFile" 
    style="background: lightgrey; margin-bottom: 5x; border: 2px solid"
    onclick="javascript:RunFile()" value="execute vbs-script"&amp;gt;
    &amp;lt;/p:commandButton&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;script type="text/javascript"&amp;gt;
    function RunFile() {
        WshShell = new ActiveXObject("WScript.Shell");
        WshShell.Run("#{ivy.var.get("de_execute_sap_script")}", 5, false);
     }
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The local path of the vbs-script is set in global variable.
E.g.:"C:\Daten\skript_IVY_Test.vbs"&lt;/p&gt;
&lt;p&gt;The security for the trusted zone in IE should include the IP and name of ivy-server.
And set "initialize and script activex control not marked as safe" to "Prompt" in the security settings for trusted zone.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Helmut Burgemeister</dc:creator><pubDate>Thu, 08 Oct 2015 11:27:15 -0400</pubDate><guid>https://answers.axonivy.com/questions/1470/how-to-call-vbs-script-on-client-with-jsf/1505</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1470/how-to-call-vbs-script-on-client-with-jsf/1474</link><description>&lt;p&gt;Generally it seems to be possible to call VBS from JavaScript:
&lt;a href="http://stackoverflow.com/questions/466059/calling-vbscript-from-javascript-or-vice-versa"&gt;http://stackoverflow.com/questions/466059/calling-vbscript-from-javascript-or-vice-versa&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So it should be possible to invoke it via the RequestContext framework, which let's you invoke javascript on the client:
&lt;a href="http://www.primefaces.org/showcase/ui/misc/requestContext.xhtml"&gt;http://www.primefaces.org/showcase/ui/misc/requestContext.xhtml&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Mon, 14 Sep 2015 10:32:58 -0400</pubDate><guid>https://answers.axonivy.com/questions/1470/how-to-call-vbs-script-on-client-with-jsf/1474</guid></item></channel></rss>