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

asked 13.09.2015 at 00:27

Helmut%20Burgemeister's gravatar image

Helmut Burge...
36457
accept rate: 100%


Here an example for a button to call a VBS-script from IE:

<div>
    <p:commandButton type="button" id="runFile" 
    style="background: lightgrey; margin-bottom: 5x; border: 2px solid"
    onclick="javascript:RunFile()" value="execute vbs-script">
    </p:commandButton>
</div>

<script type="text/javascript">
    function RunFile() {
        WshShell = new ActiveXObject("WScript.Shell");
        WshShell.Run("#{ivy.var.get("de_execute_sap_script")}", 5, false);
     }
</script>

The local path of the vbs-script is set in global variable. E.g.:"C:\Daten\skript_IVY_Test.vbs"

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.

link

answered 08.10.2015 at 11:27

Helmut%20Burgemeister's gravatar image

Helmut Burge...
36457
accept rate: 100%

edited 08.10.2015 at 11:42

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
8.2k11650

Generally it seems to be possible to call VBS from JavaScript: http://stackoverflow.com/questions/466059/calling-vbscript-from-javascript-or-vice-versa

So it should be possible to invoke it via the RequestContext framework, which let's you invoke javascript on the client: http://www.primefaces.org/showcase/ui/misc/requestContext.xhtml

link

answered 14.09.2015 at 10:32

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
8.2k11650
accept rate: 68%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×76

Asked: 13.09.2015 at 00:27

Seen: 1,293 times

Last updated: 08.10.2015 at 11:42